/** * Add site * * @return \BX\MVC\SiteController * @throws InvalidArgumentException */ public function addSite() { foreach (func_get_args() as $site) { if (!$site instanceof SiteEntity) { throw new InvalidArgumentException('Error site must be Site type'); } if (!$site->checkFields()) { $this->log()->error('Site add error: ' . implode(',', $site->getErrors()->all())); throw new InvalidArgumentException('Error validate site'); } $this->site->add($site); } return $this; }
/** * Convert values from db * @param array $values * @return \BX\Base\Collection */ public function convertFromArray(array $values) { $collection = new Collection($this->entity_class); foreach ($values as $value) { $entity = new $this->entity_class(); $entity->setData($this->prepareArrayFromDb($value), true); $collection->add($entity); } return $collection; }
public function __construct() { parent::__construct('ZendSearch\\Lucene\\Document\\Field'); }
/** * Rollback transaction */ private function rollbackUpdate() { while ($update = $this->success->pop()) { $update->rollback(); } }
/** * Constructor * @param \BX\Validator\IEntity $entity */ public function __construct(IEntity $entity) { $this->entity = $entity; parent::__construct('BX\\Validator\\Collection\\BaseValidator'); }