RestfulInterface
- Full name:
\PhalconKit\Mvc\Controller\RestfulInterface - Parent interfaces:
\PhalconKit\Mvc\Controller\Traits\Interfaces\ExposeInterface,\PhalconKit\Mvc\Controller\RestInterface
Inherited methods
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 |
getFractalManager
public getFractalManager(): \PhalconKit\Fractal\Manager
setFractalManager
public setFractalManager(?\PhalconKit\Fractal\Manager $manager): void
Parameters:
| Parameter | Type | Description |
|---|---|---|
$manager | ?\PhalconKit\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, ?\PhalconKit\Fractal\Manager $fractalManager = null): ?array
Parameters:
| Parameter | Type | Description |
|---|---|---|
$model | \Phalcon\Mvc\ModelInterface | |
$transformer | ?\League\Fractal\TransformerAbstract | |
$fractalManager | ?\PhalconKit\Fractal\Manager |
transformResultset
public transformResultset(\Phalcon\Mvc\Model\ResultsetInterface $resultset, ?\League\Fractal\TransformerAbstract $transformer = null, ?\PhalconKit\Fractal\Manager $fractalManager = null): ?array
Parameters:
| Parameter | Type | Description |
|---|---|---|
$resultset | \Phalcon\Mvc\Model\ResultsetInterface | |
$transformer | ?\League\Fractal\TransformerAbstract | |
$fractalManager | ?\PhalconKit\Fractal\Manager |
transformItem
public transformItem(mixed $data, ?\League\Fractal\TransformerAbstract $transformer = null, ?\PhalconKit\Fractal\Manager $fractalManager = null): ?array
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | mixed | |
$transformer | ?\League\Fractal\TransformerAbstract | |
$fractalManager | ?\PhalconKit\Fractal\Manager |
transformCollection
public transformCollection(mixed $data, ?\League\Fractal\TransformerAbstract $transformer = null, ?\PhalconKit\Fractal\Manager $fractalManager = null): ?array
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data | mixed | |
$transformer | ?\League\Fractal\TransformerAbstract | |
$fractalManager | ?\PhalconKit\Fractal\Manager |
getParam
public getParam(string $key, array|string|null $filters = null, mixed $default = null, ?array $params = null): mixed
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | string | |
$filters | array|string|null | |
$default | mixed | |
$params | ?array |
hasParam
public hasParam(string $key, ?array $params = null, bool $cached = true): bool
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | string | |
$params | ?array | |
$cached | bool |
getParams
public getParams(?array $fields = null, bool $cached = true, bool $deep = true): array
Parameters:
| Parameter | Type | Description |
|---|---|---|
$fields | ?array | |
$cached | bool | |
$deep | bool |
getAllParams
public getAllParams(?array $filters = null, bool $cached = true, bool $deep = true): array
Parameters:
| Parameter | Type | Description |
|---|---|---|
$filters | ?array | |
$cached | bool | |
$deep | bool |
applyFilters
public applyFilters(array<string,mixed> $params, array<string,array|string> $filters, bool $deep = true): array<string,mixed>
Parameters:
| Parameter | Type | Description |
|---|---|---|
$params | array | |
$filters | array | |
$deep | bool |
setDefaultFilters
public setDefaultFilters(array<string,array|string> $filters): static
Parameters:
| Parameter | Type | Description |
|---|---|---|
$filters | array |
addDefaultFilters
public addDefaultFilters(array<string,array|string> $filters): static
Parameters:
| Parameter | Type | Description |
|---|---|---|
$filters | array |
removeFilters
public removeFilters(string|array<int,string> $keys): static
Parameters:
| Parameter | Type | Description |
|---|---|---|
$keys | string|array |
clearDefaultFilters
public clearDefaultFilters(): static
getDefaultFilters
public getDefaultFilters(): array
getRawParams
public getRawParams(bool $cached = true): array
Parameters:
| Parameter | Type | Description |
|---|---|---|
$cached | 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 |
isDebugEnabled
public isDebugEnabled(): bool
expose
public expose(mixed $item, ?array $expose = null): array
Parameters:
| Parameter | Type | Description |
|---|---|---|
$item | mixed | |
$expose | ?array |
listExpose
public listExpose(iterable $items, ?array $listExpose = null): array
Parameters:
| Parameter | Type | Description |
|---|---|---|
$items | iterable | |
$listExpose | ?array |
exportExpose
public exportExpose(iterable $items, ?array $exportExpose = null): array
Parameters:
| Parameter | Type | Description |
|---|---|---|
$items | iterable | |
$exportExpose | ?array |