public function createCurrency(array $data = array()) { $currency = new Models\Shop\Currency(); $data = array_merge(array('currency' => 'PHP', 'factor' => 1, 'name' => 'PHP', 'default' => false, 'symbol' => 'PHP'), $data); $this->deleteCurrency($data['name']); $currency->fromArray($data); $this->entityManager->persist($currency); $this->entityManager->flush(); $this->entityManager->clear(); $this->createdCurrencies[] = $data['name']; return $currency; }
/** * {@inheritDoc} */ public function fromArray(array $array = array()) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'fromArray', array($array)); return parent::fromArray($array); }