public as_array ( ) |
public function as_array()
{
if (func_num_args() === 0) {
return $this->_data;
}
$args = func_get_args();
return array_intersect_key($this->_data, array_flip($args));
}
/** * Returns an array of all the '_col' members. The keys will be the name * of the member with the '_col' chopped off the end. * * @todo update to work with $this->_orm * @return array */ public function as_array() { if ($this->_orm) { $data = $this->_orm->as_array(); } else { $data = array(); foreach ($this as $key => $val) { if (substr($key, -4) == '_col' && $val) { $data[substr($key, 0, -4)] = $val; } } } return $data; }