1
심포니에서 설비 데이터와 MongoDB를 채우기, 나는 MongoDB를 일부 비품 데이터를 채우기 위해 노력하고있어 그게 내가 무슨 짓을했는지 :나는 심포니 프로젝트에서 일하고 있어요 3.2
<?php
namespace FrontOfficeBundle\DataFixtures\ORM;
use FrontOfficeBundle\Document\Customer;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
class Fixtures extends Fixture
{
public function load(ObjectManager $manager)
{
$customer = new Customer();
$customer->setName("Ben Abdallah");
$customer->setSurename("Wajdi");
$customer->setUsername("wajdibenabdallah");
$customer->setEmail("[email protected]");
$customer->setPhone("28812010");
$customer->setPassword("");
$manager->flush();
}
}
PHP 빈/콘솔 교리 : MongoDB를 : 비품 :
Careful, database will be purged. Do you want to continue (y/N) ?y > purging database > loading Doctrine\Bundle\FixturesBundle\EmptyFixture > loading FrontOfficeBundle\DataFixtures\ORM\Fixtures
그러나 noth : 부하 다음
와 나는 이러한 결과를 돌아왔다 데이터베이스에 (여전히 비어 있음) 문제가 발생했습니다.
I'am 사용 :
- 심포니 3.2
- MongoDB를 3.4.4
- PHP 7.0.23
어떤 아이디어 16.04 ubuntuu? 감사합니다.
$manager->persist($customer); // Store in database.
는 당신이 시도 할 수 :
감사합니다. 작동 중입니다. !!!! –