PHP 클래스 ZF\Apigility\Admin\Model\RestServiceModel

상속: implements Zend\EventManager\EventManagerAwareInterface
파일 보기 프로젝트 열기: zfcampus/zf-apigility-admin 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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