ORM::get PHP Method

get() public method

If a column-names array is passed, it will return a associative array with the value of each column or null if it is not present.
public get ( $key )
    public function get($key)
    {
        if (is_array($key)) {
            $result = array();
            foreach ($key as $column) {
                $result[$column] = isset($this->_data[$column]) ? $this->_data[$column] : null;
            }
            return $result;
        } else {
            return isset($this->_data[$key]) ? $this->_data[$key] : null;
        }
    }

Usage Example

Example #1
0
 /**
  * Add the optional last_topic column (only accessible if record_last_topic is true)
  *
  * @param string $column
  * @return mixed|ORM
  */
 public function get($column)
 {
     if ($column == 'last_topic' && parent::get('location')->record_last_topic == 1) {
         return ORM::factory('Quill_Topic')->where('category_id', '=', $this->id)->order_by('updated_at', 'DESC')->limit(1)->find();
     }
     return parent::get($column);
 }
All Usage Examples Of ORM::get
ORM