Example #1
0
 public function get_one(Query $query = null)
 {
     // do we have a query object passed?
     if (func_num_args()) {
         // return the query result
         return $query->get_one();
     }
     // make sure there's a node operation defined
     if (empty($this->_node_operation)) {
         // assume a get-all operation
         $this->_node_operation = array('related' => array(), 'single' => true, 'action' => 'all', 'to' => null);
     }
     // so we need to fetch something
     return $this->_fetch_nodes('single');
 }