src/Gossamer/Pesedget/Commands/GetCommand.php
public function execute($params = array(), $request = array()) {
        //$passableParams = $this->httpRequest->getParameters();
        //remove the uri
        // array_shift($passableParams);

        $this->getQueryBuilder()->where($params);
        $query = '';
        if ($this->entity instanceof AbstractI18nEntity) {
            $query = $this->getQueryBuilder()->getQuery($this->entity, QueryBuilder::GET_ITEM_QUERY, QueryBuilder::PARENT_AND_CHILD);
        } else {
            $query = $this->getQueryBuilder()->getQuery($this->entity, QueryBuilder::GET_ITEM_QUERY);
        }

        $firstResult = $this->query($query);
        $entityName = get_class($this->entity);

        if (is_array($firstResult) && count($firstResult) > 0) {

            $this->loadI18nValues($firstResult, $params);

            $this->loadChildTableParams($firstResult, $params);

            $this->loadOneToOneJoinTables($firstResult);

            $this->loadOneToManyJoinTables($firstResult, $params);


        }

        return array($entityName => is_array($firstResult) ? current($firstResult) : array());
    }
public function execute($params = array(), $request = array()) {
        //$passableParams = $this->httpRequest->getParameters();
        //remove the uri
        // array_shift($passableParams);

        $this->getQueryBuilder()->where($params);
        $query = '';
        if ($this->entity instanceof AbstractI18nEntity) {
            $query = $this->getQueryBuilder()->getQuery($this->entity, QueryBuilder::GET_ITEM_QUERY, QueryBuilder::PARENT_AND_CHILD);
        } else {
            $query = $this->getQueryBuilder()->getQuery($this->entity, QueryBuilder::GET_ITEM_QUERY);
        }

        $firstResult = $this->query($query);
        $entityName = get_class($this->entity);

        if (is_array($firstResult) && count($firstResult) > 0) {

            $this->loadI18nValues($firstResult, $params);

            $this->loadChildTableParams($firstResult, $params);

            $this->loadOneToOneJoinTables($firstResult);

            $this->loadOneToManyJoinTables($firstResult, $params);


        }

        return array($entityName => is_array($firstResult) ? current($firstResult) : array());
    }
public function execute ( $ params = array ( ) , $ request = array ( ) ) { //$passableParams = $this->httpRequest->getParameters(); //remove the uri // array_shift($passableParams); $ this -> getQueryBuilder ( ) -> where ( $ params ) ; $ query = '' ; if ( $ this -> entity instanceof AbstractI18nEntity ) { $ query = $ this -> getQueryBuilder ( ) -> getQuery ( $ this -> entity , QueryBuilder :: GET_ITEM_QUERY , QueryBuilder :: PARENT_AND_CHILD ) ; } else { $ query = $ this -> getQueryBuilder ( ) -> getQuery ( $ this -> entity , QueryBuilder :: GET_ITEM_QUERY ) ; } $ firstResult = $ this -> query ( $ query ) ; $ entityName = get_class ( $ this -> entity ) ; if ( is_array ( $ firstResult ) && count ( $ firstResult ) > 0 ) { $ this -> loadI18nValues ( $ firstResult , $ params ) ; $ this -> loadChildTableParams ( $ firstResult , $ params ) ; $ this -> loadOneToOneJoinTables ( $ firstResult ) ; $ this -> loadOneToManyJoinTables ( $ firstResult , $ params ) ; } return array ( $ entityName => is_array ( $ firstResult ) ? current ( $ firstResult ) : array ( ) ) ; }
retrieves a single row from the database

@param array     URI params
@param array     POST params
retrieves a single row from the database