src/Rest/CrudCustomFieldsController.php
public function getById($id): Response
    {
        //find the info
        $record = $this->model->findFirst($id);

        if (!is_object($record)) {
            throw new UnprocessableEntityHttpException('Record not found');
        }

        $relationships = false;

        //get relationship
        if ($this->request->hasQuery('relationships')) {
            $relationships = $this->request->getQuery('relationships', 'string');
        }

        $result = !$relationships ? $record->toFullArray() : QueryParserCustomFields::parseRelationShips($relationships, $record);

        return $this->response($result);
    }
public function getById($id): Response
    {
        //find the info
        $record = $this->model->findFirst($id);

        if (!is_object($record)) {
            throw new UnprocessableEntityHttpException('Record not found');
        }

        $relationships = false;

        //get relationship
        if ($this->request->hasQuery('relationships')) {
            $relationships = $this->request->getQuery('relationships', 'string');
        }

        $result = !$relationships ? $record->toFullArray() : QueryParserCustomFields::parseRelationShips($relationships, $record);

        return $this->response($result);
    }
public function getById ( $ id ) : Response { //find the info $ record = $ this -> model -> findFirst ( $ id ) ; if ( ! is_object ( $ record ) ) { throw new UnprocessableEntityHttpException ( 'Record not found' ) ; } $ relationships = false ; //get relationship if ( $ this -> request -> hasQuery ( 'relationships' ) ) { $ relationships = $ this -> request -> getQuery ( 'relationships' , 'string' ) ; } $ result = ! $ relationships ? $ record -> toFullArray ( ) : QueryParserCustomFields :: parseRelationShips ( $ relationships , $ record ) ; return $ this -> response ( $ result ) ; }
Get item.

@method GET
url /v1/controller/{id}

@param mixed $id

@return \Phalcon\Http\Response
@throws \Exception
Get item .