PHP Класс ZF\Apigility\Admin\Model\RestServiceModel

Наследование: implements Zend\EventManager\EventManagerAwareInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$configResource ZF\Configuration\ConfigResource
$events Zend\EventManager\EventManagerInterface
$module string
$moduleEntity ModuleEntity
$modulePath string
$modules ModulePathSpec
$renderer Zend\View\Renderer\PhpRenderer
$restArrayUpdateOptions array Allowed REST update options that are arrays
$restScalarUpdateOptions array Allowed REST update options that are scalars
$routeNameFilter Zend\Filter\FilterChain

Открытые методы

Метод Описание
__construct ( ModuleEntity $moduleEntity, ModulePathSpec $modules, ZF\Configuration\ConfigResource $config )
__get ( string $name ) : mixed Allow read-only access to properties
createCollectionClass ( string $serviceName ) : string Create a collection class for the resource
createContentNegotiationConfig ( RestServiceEntity $details, string $controllerService ) Create content negotiation configuration based on payload and discovered controller service name
createControllerServiceName ( string $serviceName ) : string Generate the controller service name from the module and service name
createEntityClass ( string $serviceName, string $template = 'entity', RestServiceEntity $details = null ) : string Create an entity class for the resource
createFactoryClass ( $serviceName )
createHalConfig ( RestServiceEntity $details, string $entityClass, string $collectionClass, string $routeName ) Create HAL configuration
createMediaType ( ) : string Create the mediatype for this
createResourceClass ( string $serviceName ) : string Creates a new resource class based on the specified service name
createRestConfig ( RestServiceEntity $details, string $controllerService, string $resourceClass, string $routeName ) Creates REST configuration
createRoute ( string $serviceName, string $route, string $routeIdentifier, string $controllerService ) : string Create the route configuration
createService ( RestServiceEntity $details ) : RestServiceEntity Create a new service using the details provided
deleteAuthorizationConfig ( RestServiceEntity $entity ) Delete any authorization configuration for a service
deleteContentNegotiationConfig ( RestServiceEntity $entity ) Delete content-negotiation configuration associated with a service
deleteContentValidationConfig ( RestServiceEntity $entity ) Delete content-validation configuration associated with a service
deleteHalConfig ( RestServiceEntity $entity ) Delete HAL configuration for the service
deleteRestConfig ( RestServiceEntity $entity ) Delete the REST configuration associated with the given service
deleteRoute ( RestServiceEntity $entity ) Delete the route associated with the given service
deleteService ( string $controllerService, boolean $recursive = false ) : true Delete a named service
deleteServiceManagerConfig ( RestServiceEntity $entity ) Delete any service manager configuration for the resource
deleteVersioningConfig ( RestServiceEntity $entity ) Delete versioning configuration for a service
fetch ( string $controllerService, boolean $isAFetchOperation = true ) : RestServiceEntity | false
fetchAll ( integer $version = null ) : RestServiceEntity[] Fetch all services
getEventManager ( ) : Zend\EventManager\EventManagerInterface Retrieve the EventManager instance
setEventManager ( Zend\EventManager\EventManagerInterface $events ) Set the EventManager instance
updateContentNegotiationConfig ( RestServiceEntity $original, RestServiceEntity $update ) Update the content negotiation configuration for the service
updateHalConfig ( RestServiceEntity $original, RestServiceEntity $update ) Update HAL configuration
updateRestConfig ( RestServiceEntity $original, RestServiceEntity $update ) Update REST configuration
updateRoute ( RestServiceEntity $original, RestServiceEntity $update ) Update the route for an existing service
updateService ( RestServiceEntity $update ) : RestServiceEntity Update an existing service

Защищенные методы

Метод Описание
createClassFile ( Zend\View\Model\ViewModel $model, string $type, string $classPath ) : boolean Create a class file
deriveCollectionClass ( string $controllerServiceName, RestServiceEntity $metadata, array $config ) : string Derive the name of the collection class from the controller service name
deriveEntityClass ( string $controllerServiceName, RestServiceEntity $metadata, array $config ) : string Derive the name of the entity class from the controller service name
getConfigForSubkey ( string $subKey, array | mixed $default = [] ) : mixed Traverse an array for a subkey
getRenderer ( ) : Zend\View\Renderer\PhpRenderer Get a renderer instance
getRouteInfo ( RestServiceEntity $metadata, array $config ) Retrieve route information for a given service based on the configuration available
getRouteNameFilter ( ) : Zend\Filter\FilterChain Retrieve the filter chain for generating the route name
getSourcePath ( string $serviceName ) : string Get the source path for the module
injectResolver ( Zend\View\Renderer\PhpRenderer $renderer, string $type ) : string Inject the renderer with a resolver
mergeContentNegotiationConfig ( string $controllerServiceName, RestServiceEntity $metadata, array $config ) Merge the content negotiation configuration for the given controller service into the REST metadata
mergeHalConfig ( string $controllerServiceName, RestServiceEntity $metadata, array $config ) Merge entity and collection class into metadata, if found
routeAlreadyExist ( string $route, string $excludeRouteName = null ) : boolean Check if a route already exist in the configuration

Приватные методы

Метод Описание
moduleNameToRegex ( ) : string Converts a module name (which could include namespace separators) into a string that can be used in regex matches. Use-cases: - Acme\Account => Acme\\Account - Acme\\Account (ideally it should never happen) => Acme\\Account - Acme => Acme

Описание методов

__construct() публичный Метод

public __construct ( ModuleEntity $moduleEntity, ModulePathSpec $modules, ZF\Configuration\ConfigResource $config )
$moduleEntity ModuleEntity
$modules ModulePathSpec
$config ZF\Configuration\ConfigResource

__get() публичный Метод

Allow read-only access to properties
public __get ( string $name ) : mixed
$name string
Результат mixed

createClassFile() защищенный Метод

Creates a class file based on the view model passed, the type of resource, and writes it to the path provided.
protected createClassFile ( Zend\View\Model\ViewModel $model, string $type, string $classPath ) : boolean
$model Zend\View\Model\ViewModel
$type string
$classPath string
Результат boolean

createCollectionClass() публичный Метод

Create a collection class for the resource
public createCollectionClass ( string $serviceName ) : string
$serviceName string
Результат string The name of the newly created collection class

createContentNegotiationConfig() публичный Метод

Create content negotiation configuration based on payload and discovered controller service name
public createContentNegotiationConfig ( RestServiceEntity $details, string $controllerService )
$details RestServiceEntity
$controllerService string

createControllerServiceName() публичный Метод

Generate the controller service name from the module and service name
public createControllerServiceName ( string $serviceName ) : string
$serviceName string
Результат string

createEntityClass() публичный Метод

Create an entity class for the resource
public createEntityClass ( string $serviceName, string $template = 'entity', RestServiceEntity $details = null ) : string
$serviceName string
$template string Which template to use; defaults to 'entity'
$details RestServiceEntity
Результат string The name of the newly created entity class

createFactoryClass() публичный Метод

public createFactoryClass ( $serviceName )

createHalConfig() публичный Метод

Create HAL configuration
public createHalConfig ( RestServiceEntity $details, string $entityClass, string $collectionClass, string $routeName )
$details RestServiceEntity
$entityClass string
$collectionClass string
$routeName string

createMediaType() публичный Метод

Based on the module and the latest module version.
public createMediaType ( ) : string
Результат string

createResourceClass() публичный Метод

Creates a new resource class based on the specified service name
public createResourceClass ( string $serviceName ) : string
$serviceName string
Результат string The name of the newly created class

createRestConfig() публичный Метод

Creates REST configuration
public createRestConfig ( RestServiceEntity $details, string $controllerService, string $resourceClass, string $routeName )
$details RestServiceEntity
$controllerService string
$resourceClass string
$routeName string

createRoute() публичный Метод

Create the route configuration
public createRoute ( string $serviceName, string $route, string $routeIdentifier, string $controllerService ) : string
$serviceName string
$route string
$routeIdentifier string
$controllerService string
Результат string

createService() публичный Метод

Create a new service using the details provided
public createService ( RestServiceEntity $details ) : RestServiceEntity
$details RestServiceEntity
Результат RestServiceEntity

deleteAuthorizationConfig() публичный Метод

Delete any authorization configuration for a service
public deleteAuthorizationConfig ( RestServiceEntity $entity )
$entity RestServiceEntity

deleteContentNegotiationConfig() публичный Метод

Delete content-negotiation configuration associated with a service
public deleteContentNegotiationConfig ( RestServiceEntity $entity )
$entity RestServiceEntity

deleteContentValidationConfig() публичный Метод

Delete content-validation configuration associated with a service
public deleteContentValidationConfig ( RestServiceEntity $entity )
$entity RestServiceEntity

deleteHalConfig() публичный Метод

Delete HAL configuration for the service
public deleteHalConfig ( RestServiceEntity $entity )
$entity RestServiceEntity

deleteRestConfig() публичный Метод

Delete the REST configuration associated with the given service
public deleteRestConfig ( RestServiceEntity $entity )
$entity RestServiceEntity

deleteRoute() публичный Метод

Delete the route associated with the given service
public deleteRoute ( RestServiceEntity $entity )
$entity RestServiceEntity

deleteService() публичный Метод

Delete a named service
public deleteService ( string $controllerService, boolean $recursive = false ) : true
$controllerService string
$recursive boolean
Результат true

deleteServiceManagerConfig() публичный Метод

Delete any service manager configuration for the resource
public deleteServiceManagerConfig ( RestServiceEntity $entity )
$entity RestServiceEntity

deleteVersioningConfig() публичный Метод

Removes the route name from zf-versioning.
public deleteVersioningConfig ( RestServiceEntity $entity )
$entity RestServiceEntity

deriveCollectionClass() защищенный Метод

Derive the name of the collection class from the controller service name
protected deriveCollectionClass ( string $controllerServiceName, RestServiceEntity $metadata, array $config ) : string
$controllerServiceName string
$metadata RestServiceEntity
$config array
Результат string

deriveEntityClass() защищенный Метод

Derive the name of the entity class from the controller service name
protected deriveEntityClass ( string $controllerServiceName, RestServiceEntity $metadata, array $config ) : string
$controllerServiceName string
$metadata RestServiceEntity
$config array
Результат string

fetch() публичный Метод

public fetch ( string $controllerService, boolean $isAFetchOperation = true ) : RestServiceEntity | false
$controllerService string
$isAFetchOperation boolean If this is for a non-fetch operation, pass boolean false; allows listeners to include additional data necessary for clean updates.
Результат RestServiceEntity | false

fetchAll() публичный Метод

Fetch all services
public fetchAll ( integer $version = null ) : RestServiceEntity[]
$version integer
Результат RestServiceEntity[]

getConfigForSubkey() защищенный Метод

Subkey is given in "." notation, which is then split, and the configuration is traversed until no more keys are available, or a corresponding entry is not found; in the latter case, the $default will be provided.
protected getConfigForSubkey ( string $subKey, array | mixed $default = [] ) : mixed
$subKey string
$default array | mixed
Результат mixed

getEventManager() публичный Метод

Lazy instantiates one if none currently registered
public getEventManager ( ) : Zend\EventManager\EventManagerInterface
Результат Zend\EventManager\EventManagerInterface

getRenderer() защищенный Метод

Get a renderer instance
protected getRenderer ( ) : Zend\View\Renderer\PhpRenderer
Результат Zend\View\Renderer\PhpRenderer

getRouteInfo() защищенный Метод

Retrieve route information for a given service based on the configuration available
protected getRouteInfo ( RestServiceEntity $metadata, array $config )
$metadata RestServiceEntity
$config array

getRouteNameFilter() защищенный Метод

Retrieve the filter chain for generating the route name
protected getRouteNameFilter ( ) : Zend\Filter\FilterChain
Результат Zend\Filter\FilterChain

getSourcePath() защищенный Метод

Get the source path for the module
protected getSourcePath ( string $serviceName ) : string
$serviceName string
Результат string

injectResolver() защищенный Метод

Seed the resolver with a template name and path based on the $type passed, and inject it into the renderer.
protected injectResolver ( Zend\View\Renderer\PhpRenderer $renderer, string $type ) : string
$renderer Zend\View\Renderer\PhpRenderer
$type string
Результат string Template name

mergeContentNegotiationConfig() защищенный Метод

Merge the content negotiation configuration for the given controller service into the REST metadata
protected mergeContentNegotiationConfig ( string $controllerServiceName, RestServiceEntity $metadata, array $config )
$controllerServiceName string
$metadata RestServiceEntity
$config array

mergeHalConfig() защищенный Метод

Merge entity and collection class into metadata, if found
protected mergeHalConfig ( string $controllerServiceName, RestServiceEntity $metadata, array $config )
$controllerServiceName string
$metadata RestServiceEntity
$config array

routeAlreadyExist() защищенный Метод

Check if a route already exist in the configuration
protected routeAlreadyExist ( string $route, string $excludeRouteName = null ) : boolean
$route string
$excludeRouteName string
Результат boolean

setEventManager() публичный Метод

Set the EventManager instance
public setEventManager ( Zend\EventManager\EventManagerInterface $events )
$events Zend\EventManager\EventManagerInterface

updateContentNegotiationConfig() публичный Метод

Update the content negotiation configuration for the service
public updateContentNegotiationConfig ( RestServiceEntity $original, RestServiceEntity $update )
$original RestServiceEntity
$update RestServiceEntity

updateHalConfig() публичный Метод

Update HAL configuration
public updateHalConfig ( RestServiceEntity $original, RestServiceEntity $update )
$original RestServiceEntity
$update RestServiceEntity

updateRestConfig() публичный Метод

Update REST configuration
public updateRestConfig ( RestServiceEntity $original, RestServiceEntity $update )
$original RestServiceEntity
$update RestServiceEntity

updateRoute() публичный Метод

Update the route for an existing service
public updateRoute ( RestServiceEntity $original, RestServiceEntity $update )
$original RestServiceEntity
$update RestServiceEntity

updateService() публичный Метод

Update an existing service
public updateService ( RestServiceEntity $update ) : RestServiceEntity
$update RestServiceEntity
Результат RestServiceEntity

Описание свойств

$configResource защищенное свойство

protected ConfigResource,ZF\Configuration $configResource
Результат ZF\Configuration\ConfigResource

$events защищенное свойство

protected EventManagerInterface,Zend\EventManager $events
Результат Zend\EventManager\EventManagerInterface

$module защищенное свойство

protected string $module
Результат string

$moduleEntity защищенное свойство

protected ModuleEntity,ZF\Apigility\Admin\Model $moduleEntity
Результат ModuleEntity

$modulePath защищенное свойство

protected string $modulePath
Результат string

$modules защищенное свойство

protected ModulePathSpec,ZF\Apigility\Admin\Model $modules
Результат ModulePathSpec

$renderer защищенное свойство

protected PhpRenderer,Zend\View\Renderer $renderer
Результат Zend\View\Renderer\PhpRenderer

$restArrayUpdateOptions защищенное свойство

Allowed REST update options that are arrays
protected array $restArrayUpdateOptions
Результат array

$restScalarUpdateOptions защищенное свойство

Allowed REST update options that are scalars
protected array $restScalarUpdateOptions
Результат array

$routeNameFilter защищенное свойство

protected FilterChain,Zend\Filter $routeNameFilter
Результат Zend\Filter\FilterChain