/** * @param Account $account * @param bool $andFlush * @todo need remove this method after task CRM-272 will done */ public function generate(Account $account, $andFlush = false) { $channel = new Channel(); $channel->setAccount($account); $channel->setName('Привлечение'); $dealState = new DealState(); $dealState->setName('Звонок'); $dealState->setAccount($account); $dealState->setIcon('fa fa-phone'); $this->em->persist($channel); $this->em->persist($dealState); if ($andFlush) { $this->em->flush(); } }
/** * @return DealState */ public function create() { $dealState = new DealState(); $dealState->setAccount($this->getCurrentAccount()); return $dealState; }