Автор: Adam Piotrowski (adam@wellcommerce.org)
Наследование: extends WellCommerce\Bundle\DoctrineBundle\Entity\AbstractEntity, implements WellCommerce\Bundle\CompanyBundle\Entity\CompanyInterface, use trait Knp\DoctrineBehaviors\Model\Timestampable\Timestampable, use trait Knp\DoctrineBehaviors\Model\Blameable\Blameable
Пример #1
0
 public function create() : CompanyInterface
 {
     $company = new Company();
     $company->setName('');
     $company->setShortName('');
     $company->setAddress($this->companyAddressFactory->create());
     return $company;
 }
Пример #2
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     for ($i = 0; $i < 10; $i++) {
         $company = new Company();
         $company->setName($this->fakerGenerator->company . ' ' . $this->fakerGenerator->companySuffix);
         $company->setShortName($this->fakerGenerator->company);
         $company->setCountry($this->fakerGenerator->countryCode);
         $company->setStreet($this->fakerGenerator->streetName);
         $company->setStreetNo($this->fakerGenerator->streetSuffix);
         $company->setFlatNo($this->fakerGenerator->randomNumber());
         $company->setPostCode($this->fakerGenerator->postcode);
         $company->setCity($this->fakerGenerator->city);
         $manager->persist($company);
     }
     $manager->flush();
 }