コード例 #1
0
ファイル: LoadSalesData.php プロジェクト: umpirsky/marello
 /**
  * load and create SalesChannels
  */
 protected function loadSalesChannels()
 {
     $organization = $this->manager->getRepository('OroOrganizationBundle:Organization')->getFirst();
     $i = 1;
     foreach ($this->data as $values) {
         $channel = new SalesChannel($values['name']);
         $channel->setChannelType($values['type']);
         $channel->setOwner($organization);
         $this->manager->persist($channel);
         $this->setReference('marello_sales_channel_' . $i, $channel);
         $i++;
     }
     $this->manager->flush();
 }
コード例 #2
0
ファイル: Order.php プロジェクト: umpirsky/marello
 /**
  * @ORM\PrePersist
  */
 public function prePersist()
 {
     $this->createdAt = $this->updatedAt = new \DateTime('now', new \DateTimeZone('UTC'));
     $this->salesChannelName = $this->salesChannel->getName();
 }