示例#1
0
 /**
  * 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;
 }
示例#2
0
文件: SqlBuilder.php 项目: jarick/bx
 /**
  * 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;
 }
示例#3
0
 public function __construct()
 {
     parent::__construct('ZendSearch\\Lucene\\Document\\Field');
 }
示例#4
0
文件: Repository.php 项目: jarick/bx
 /**
  * Rollback transaction
  */
 private function rollbackUpdate()
 {
     while ($update = $this->success->pop()) {
         $update->rollback();
     }
 }
示例#5
0
文件: LazyValue.php 项目: jarick/bx
 /**
  * Constructor
  * @param \BX\Validator\IEntity $entity
  */
 public function __construct(IEntity $entity)
 {
     $this->entity = $entity;
     parent::__construct('BX\\Validator\\Collection\\BaseValidator');
 }