public function getResult($profile = [])
    {

        $profile['userName'] = $this->userName;
        $profile['token'] = $this->token;

        $di = \Phalcon\Di::getDefault();
        // the final result generated by the entity object
        $result = $di->get('result', ['profile']);
        $result->outputMode = 'single';

        $id = (isset($profile['id'])) ? $profile['id'] : 1;
        $data = $di->get('data', [$id, 'profile', $profile]);
        $result->addData($data);
        return $result;
    }
public function getResult($profile = [])
    {

        $profile['userName'] = $this->userName;
        $profile['token'] = $this->token;

        $di = \Phalcon\Di::getDefault();
        // the final result generated by the entity object
        $result = $di->get('result', ['profile']);
        $result->outputMode = 'single';

        $id = (isset($profile['id'])) ? $profile['id'] : 1;
        $data = $di->get('data', [$id, 'profile', $profile]);
        $result->addData($data);
        return $result;
    }
public function getResult ( $ profile = [ ] ) { $ profile [ 'userName' ] = $ this -> userName ; $ profile [ 'token' ] = $ this -> token ; $ di = \ Phalcon \ Di :: getDefault ( ) ; // the final result generated by the entity object $ result = $ di -> get ( 'result' , [ 'profile' ] ) ; $ result -> outputMode = 'single' ; $ id = ( isset ( $ profile [ 'id' ] ) ) ? $ profile [ 'id' ] : 1 ; $ data = $ di -> get ( 'data' , [ $ id , 'profile' , $ profile ] ) ; $ result -> addData ( $ data ) ; return $ result ; }
take an array of profile data and return a fully compatible result set

@param array $profile
@return \PhalconRest\Result\Result
take an array of profile data and return a fully compatible result set