/** * {@inheritdoc} */ public function add($data) { if ($this->crudManager instanceof CrudManagerInterface) { $this->crudManager->add($data); } else { $this->entityManager->persist($data); } $this->entityManager->flush($data); }
/** * {@inheritdoc} */ public function update($data) { if (!$data instanceof \Persistent) { throw new \InvalidArgumentException('The $data instance is not supported by the Propel implementation'); } if ($this->crudManager instanceof CrudManagerInterface) { $this->crudManager->add($data); } else { $data->save(); } }