Example #1
0
 public function fromArray(array $values)
 {
     foreach ($values as $attribute => $value) {
         if (property_exists($this, $attribute)) {
             $attribute = \Util\Text::sanitizeAttributeName($attribute);
             $this->{$attribute} = $value;
         }
     }
 }
Example #2
0
File: Bo.php Project: pixlr/SZES
 public function __construct(\Model\DAO\Engine\DaoLoader $dao)
 {
     $this->dao_loader = $dao;
     $this->dao = $this->dao_loader[get_called_class()];
     $this->labels = array();
     $cols = $this->dao->getColumns();
     foreach ($cols as $col) {
         $this->labels[$col] = \Util\Text::generateLabel($col);
     }
 }
Example #3
0
File: Dao.php Project: pixlr/SZES
 protected function entityFromArray(array $values)
 {
     $object = false;
     if (!empty($values)) {
         $class = '\\Model\\' . \Util\Text::classNameOnly(get_called_class());
         $object = new $class();
         $object->fromArray($values);
     }
     return $object;
 }
Example #4
0
 public function offsetUnset($dao_name)
 {
     unset($this->container[\Util\Text::classNameOnly($dao_name)]);
 }