public function get()
    {
         // run the callbacks to retirve the results
        $results = $this->executeResultFetcher();

        // we always exprect an array here!
        if (!is_array($results) || empty($results))
        {
            $results = array();
        }

        // In case we should forward a key means using a value
        // from every result as array key.
        if ((!empty($results)) && $this->forwardKey !== false && is_string($this->forwardKey)) 
        {
            $rawResults = $results;
            $results = array();

            // check if the collection is beeing fetched 
            // as an associated array 
            if (!is_array(reset($rawResults)))
            {
                throw new Exception('Cannot forward key, the result is no associated array.');
            }

            foreach ($rawResults as $result) 
            {
                $results[$result[$this->forwardKey]] = $result;
            }
        }

        // Group the resuls by a items value
        if ((!empty($results)) && $this->groupResults !== false && is_string($this->groupResults)) 
        {
            $rawResults = $results;
            $results = array();

            // check if the collection is beeing fetched 
            // as an associated array 
            if (!is_array(reset($rawResults)))
            {
                throw new Exception('Cannot forward key, the result is no associated array.');
            }

            foreach ($rawResults as $key => $result) 
            {
                $results[$result[$this->groupResults]][$key] = $result;
            }
        }

        // when the limit is specified to exactly one result we
        // return directly that one result instead of the entire array
        if ($this->limit === 1) 
        {
            $results = reset($results);
        }

        return $results;
    }
public function get()
    {
         // run the callbacks to retirve the results
        $results = $this->executeResultFetcher();

        // we always exprect an array here!
        if (!is_array($results) || empty($results))
        {
            $results = array();
        }

        // In case we should forward a key means using a value
        // from every result as array key.
        if ((!empty($results)) && $this->forwardKey !== false && is_string($this->forwardKey)) 
        {
            $rawResults = $results;
            $results = array();

            // check if the collection is beeing fetched 
            // as an associated array 
            if (!is_array(reset($rawResults)))
            {
                throw new Exception('Cannot forward key, the result is no associated array.');
            }

            foreach ($rawResults as $result) 
            {
                $results[$result[$this->forwardKey]] = $result;
            }
        }

        // Group the resuls by a items value
        if ((!empty($results)) && $this->groupResults !== false && is_string($this->groupResults)) 
        {
            $rawResults = $results;
            $results = array();

            // check if the collection is beeing fetched 
            // as an associated array 
            if (!is_array(reset($rawResults)))
            {
                throw new Exception('Cannot forward key, the result is no associated array.');
            }

            foreach ($rawResults as $key => $result) 
            {
                $results[$result[$this->groupResults]][$key] = $result;
            }
        }

        // when the limit is specified to exactly one result we
        // return directly that one result instead of the entire array
        if ($this->limit === 1) 
        {
            $results = reset($results);
        }

        return $results;
    }
public function get ( ) { // run the callbacks to retirve the results $ results = $ this -> executeResultFetcher ( ) ; // we always exprect an array here! if ( ! is_array ( $ results ) || empty ( $ results ) ) { $ results = array ( ) ; } // In case we should forward a key means using a value // from every result as array key. if ( ( ! empty ( $ results ) ) && $ this -> forwardKey !== false && is_string ( $ this -> forwardKey ) ) { $ rawResults = $ results ; $ results = array ( ) ; // check if the collection is beeing fetched  // as an associated array  if ( ! is_array ( reset ( $ rawResults ) ) ) { throw new Exception ( 'Cannot forward key, the result is no associated array.' ) ; } foreach ( $ rawResults as $ result ) { $ results [ $ result [ $ this -> forwardKey ] ] = $ result ; } } // Group the resuls by a items value if ( ( ! empty ( $ results ) ) && $ this -> groupResults !== false && is_string ( $ this -> groupResults ) ) { $ rawResults = $ results ; $ results = array ( ) ; // check if the collection is beeing fetched  // as an associated array  if ( ! is_array ( reset ( $ rawResults ) ) ) { throw new Exception ( 'Cannot forward key, the result is no associated array.' ) ; } foreach ( $ rawResults as $ key => $ result ) { $ results [ $ result [ $ this -> groupResults ] ] [ $ key ] = $ result ; } } // when the limit is specified to exactly one result we // return directly that one result instead of the entire array if ( $ this -> limit === 1 ) { $ results = reset ( $ results ) ; } return $ results ; }
Executes the `executeResultFetcher` callback and handles the results.

@return mixed The fetched result.
Executes the executeResultFetcher callback and handles the results .