Skip to content

RestInterface

Inherited methods

isDebugEnabled

public isDebugEnabled(): bool

attachBehavior

public attachBehavior(string $eventClass, ?string $eventType = null, ?int $priority = null): void

Parameters:

Parameter Type Description
$eventClass string
$eventType ?string
$priority ?int

attachBehaviors

public attachBehaviors(array $behaviors = [], string $eventType = null, ?int $priority = null): void

Parameters:

Parameter Type Description
$behaviors array
$eventType string
$priority ?int

getParam

public getParam(string $key, array|string|null $filters = null, string $default = null, array $params = null): mixed

Parameters:

Parameter Type Description
$key string
$filters **array string
$default string
$params array

getParams

public getParams(array $filters = null): array

Parameters:

Parameter Type Description
$filters array

getFractalManager

public getFractalManager(): \Zemit\Fractal\Manager

setFractalManager

public setFractalManager(?\Zemit\Fractal\Manager $manager): void

Parameters:

Parameter Type Description
$manager ?\Zemit\Fractal\Manager

getFractalSerializer

public getFractalSerializer(): \League\Fractal\Serializer\SerializerAbstract

setFractalSerializer

public setFractalSerializer(\League\Fractal\Serializer\SerializerAbstract $serializer): void

Parameters:

Parameter Type Description
$serializer \League\Fractal\Serializer\SerializerAbstract

getTransformer

public getTransformer(): \League\Fractal\TransformerAbstract

setTransformer

public setTransformer(?\League\Fractal\TransformerAbstract $transformer = null): void

Parameters:

Parameter Type Description
$transformer ?\League\Fractal\TransformerAbstract

hasTransformer

public hasTransformer(): bool

transformModel

public transformModel(\Phalcon\Mvc\ModelInterface $model, ?\League\Fractal\TransformerAbstract $transformer = null, ?\Zemit\Fractal\Manager $fractalManager = null): ?array

Parameters:

Parameter Type Description
$model \Phalcon\Mvc\ModelInterface
$transformer ?\League\Fractal\TransformerAbstract
$fractalManager ?\Zemit\Fractal\Manager

transformResultset

public transformResultset(\Phalcon\Mvc\Model\ResultsetInterface $resultset, ?\League\Fractal\TransformerAbstract $transformer = null, ?\Zemit\Fractal\Manager $fractalManager = null): ?array

Parameters:

Parameter Type Description
$resultset \Phalcon\Mvc\Model\ResultsetInterface
$transformer ?\League\Fractal\TransformerAbstract
$fractalManager ?\Zemit\Fractal\Manager

transformItem

public transformItem(mixed $data, ?\League\Fractal\TransformerAbstract $transformer = null, ?\Zemit\Fractal\Manager $fractalManager = null): ?array

Parameters:

Parameter Type Description
$data mixed
$transformer ?\League\Fractal\TransformerAbstract
$fractalManager ?\Zemit\Fractal\Manager

transformCollection

public transformCollection(mixed $data, ?\League\Fractal\TransformerAbstract $transformer = null, ?\Zemit\Fractal\Manager $fractalManager = null): ?array

Parameters:

Parameter Type Description
$data mixed
$transformer ?\League\Fractal\TransformerAbstract
$fractalManager ?\Zemit\Fractal\Manager

setRestErrorResponse

public setRestErrorResponse(int $code = 400, string $status = 'Bad Request', mixed $response = null): \Phalcon\Http\ResponseInterface

Parameters:

Parameter Type Description
$code int
$status string
$response mixed

setRestResponse

public setRestResponse(mixed $response = null, int $code = null, string $status = null, int $jsonOptions, int $depth = 512): \Phalcon\Http\ResponseInterface

Parameters:

Parameter Type Description
$response mixed
$code int
$status string
$jsonOptions int
$depth int