application/modules/g/controllers/ExtController.php
protected function _modifyAfterCreate($response, $request) {
        if (!$this->_methodFailed($response)) {
            // figure out model name (request.method)
            $methodParts = explode('.', $request['method']);
            $modelClass  = Garp_Content_Api::modelAliasToClass(array_shift($methodParts));
            $model = new $modelClass();
            // combine primary keys to query params
            $primaryKey = array_values((array)$model->info(Zend_Db_Table::PRIMARY));
            $primaryKeyValues = array_values((array)$response['result']);
            $query = array();
            foreach ($primaryKey as $i => $key) {
                $query[$key] = $primaryKeyValues[$i];
            }
            // find the newly inserted rows
            $man = new Garp_Content_Manager(get_class($model));
            $rows = $man->fetch(array('query' => $query));
            $response['result'] = array(
                'rows' => $rows
            );
        }
        return $response;
    }
protected function _modifyAfterCreate($response, $request) {
        if (!$this->_methodFailed($response)) {
            // figure out model name (request.method)
            $methodParts = explode('.', $request['method']);
            $modelClass  = Garp_Content_Api::modelAliasToClass(array_shift($methodParts));
            $model = new $modelClass();
            // combine primary keys to query params
            $primaryKey = array_values((array)$model->info(Zend_Db_Table::PRIMARY));
            $primaryKeyValues = array_values((array)$response['result']);
            $query = array();
            foreach ($primaryKey as $i => $key) {
                $query[$key] = $primaryKeyValues[$i];
            }
            // find the newly inserted rows
            $man = new Garp_Content_Manager(get_class($model));
            $rows = $man->fetch(array('query' => $query));
            $response['result'] = array(
                'rows' => $rows
            );
        }
        return $response;
    }
protected function _modifyAfterCreate ( $ response , $ request ) { if ( ! $ this -> _methodFailed ( $ response ) ) { // figure out model name (request.method) $ methodParts = explode ( '.' , $ request [ 'method' ] ) ; $ modelClass = Garp_Content_Api :: modelAliasToClass ( array_shift ( $ methodParts ) ) ; $ model = new $ modelClass ( ) ; // combine primary keys to query params $ primaryKey = array_values ( ( array ) $ model -> info ( Zend_Db_Table :: PRIMARY ) ) ; $ primaryKeyValues = array_values ( ( array ) $ response [ 'result' ] ) ; $ query = array ( ) ; foreach ( $ primaryKey as $ i => $ key ) { $ query [ $ key ] = $ primaryKeyValues [ $ i ] ; } // find the newly inserted rows $ man = new Garp_Content_Manager ( get_class ( $ model ) ) ; $ rows = $ man -> fetch ( array ( 'query' => $ query ) ) ; $ response [ 'result' ] = array ( 'rows' => $ rows ) ; } return $ response ; }
Modify results after create

@param Array $response The original response
@param Array $request The original request
@return String
Modify results after create