public function get($condition)
    {
        $result = null;
        $this->hook->attach('collection.get.before', $condition, $result, $this);

        if (isset($result)) {
            return $result;
        }

        if (!is_array($condition)) {
            $condition = array('collection_id' => $condition);
        }

        $condition['limit'] = array(0, 1);
        $list = (array) $this->getList($condition);
        $result = empty($list) ? array() : reset($list);

        $this->hook->attach('collection.get.after', $condition, $result, $this);
        return $result;
    }
public function get($condition)
    {
        $result = null;
        $this->hook->attach('collection.get.before', $condition, $result, $this);

        if (isset($result)) {
            return $result;
        }

        if (!is_array($condition)) {
            $condition = array('collection_id' => $condition);
        }

        $condition['limit'] = array(0, 1);
        $list = (array) $this->getList($condition);
        $result = empty($list) ? array() : reset($list);

        $this->hook->attach('collection.get.after', $condition, $result, $this);
        return $result;
    }
public function get ( $ condition ) { $ result = null ; $ this -> hook -> attach ( 'collection.get.before' , $ condition , $ result , $ this ) ; if ( isset ( $ result ) ) { return $ result ; } if ( ! is_array ( $ condition ) ) { $ condition = array ( 'collection_id' => $ condition ) ; } $ condition [ 'limit' ] = array ( 0 , 1 ) ; $ list = ( array ) $ this -> getList ( $ condition ) ; $ result = empty ( $ list ) ? array ( ) : reset ( $ list ) ; $ this -> hook -> attach ( 'collection.get.after' , $ condition , $ result , $ this ) ; return $ result ; }
Loads a collection from the database
@param array|int|string $condition
@return array
Loads a collection from the database