/** * сохранение площадки * * @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(); }
/** * Сохраняет кампанию и хеширует 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(); }