public function fromArray(array $values) { foreach ($values as $attribute => $value) { if (property_exists($this, $attribute)) { $attribute = \Util\Text::sanitizeAttributeName($attribute); $this->{$attribute} = $value; } } }
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); } }
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; }
public function offsetUnset($dao_name) { unset($this->container[\Util\Text::classNameOnly($dao_name)]); }