Exemplo n.º 1
0
 /**
  * сохранение площадки
  *
  * @param Platform $platform
  */
 public function save(Platform $platform)
 {
     $isNew = $platform->getId() ? false : true;
     $this->em->persist($platform);
     $this->em->flush($platform);
     if ($isNew) {
         $platform->setHashId($this->hashids->encode($platform->getId()));
     }
     $platform->updateUpdatedAt();
     $this->tagManager->saveTagging($platform);
     $this->em->flush();
 }
Exemplo n.º 2
0
 /**
  * Сохраняет кампанию и хеширует id
  *
  * @param Campaign $campaign
  */
 public function save(Campaign $campaign)
 {
     $isNew = $campaign->getId() ? false : true;
     $this->em->persist($campaign);
     $this->em->flush($campaign);
     if ($isNew) {
         $campaign->setHashId($this->hashids->encode($campaign->getId()));
     }
     $campaign->updateUpdatedAt();
     $this->tagManager->saveTagging($campaign);
     $this->em->flush();
 }