PHP Class ZF\Apigility\Admin\Model\RpcServiceModel

Mostrar archivo Open project: zfcampus/zf-apigility-admin

Protected Properties

Property Type Description
$configResource ZF\Configuration\ConfigResource
$filter Zend\Filter\FilterChain
$module string
$moduleEntity ModuleEntity
$modules ModulePathSpec

Public Methods

Method Description
__construct ( ModuleEntity $moduleEntity, ModulePathSpec $modules, ZF\Configuration\ConfigResource $config )
createContentNegotiationConfig ( string $controllerService, string $selector = null ) : array Create the selector configuration
createController ( string $serviceName ) : object | false Create a controller in the current module named for the given service
createFactoryController ( string $serviceName ) : boolean | string
createMediaType ( ) : string Create the mediatype for this
createRoute ( string $route, string $serviceName, string $controllerService = null ) : string Create the route configuration
createRpcConfig ( string $serviceName, string $controllerService, string $routeName, array $httpMethods = ['GET'], null | string | callable $callable = null ) : array Create the zf-rpc configuration for the controller service
createService ( string $serviceName, string $routeMatch, array $httpMethods, null | string $selector = null ) : RpcServiceEntity Create a new RPC service in this module
deleteAuthorizationConfig ( string $serviceName ) Delete authorization configuration associated with a service
deleteContentNegotiationConfig ( string $serviceName ) Delete the Content Negotiation configuration for a named RPC service
deleteContentValidationConfig ( string $serviceName ) Delete content-validation configuration associated with a service
deleteControllersConfig ( string $serviceName ) Remove any controller service configuration for a service
deleteRouteConfig ( string $routeName, string $serviceName ) Removes the route configuration for a named route
deleteRpcConfig ( string $serviceName ) Delete the RPC configuration for a named RPC service
deleteService ( RpcServiceEntity $entity, boolean $recursive = false ) : true Delete a service
deleteVersioningConfig ( string $routeName, string $serviceName ) Delete any versionin configuration for a service
fetch ( string $controllerServiceName ) : RpcServiceEntity | false Fetch a single RPC service
fetchAll ( integer $version = null ) : RpcServiceEntity[] Fetch all services
updateContentNegotiationWhitelist ( string $controllerService, string $headerType, array $whitelist ) : true Update configuration for a content negotiation whitelist for a named controller service
updateHttpMethods ( string $controllerService, array $httpMethods ) : true Update the allowed HTTP methods for a given service
updateRoute ( string $controllerService, string $routeMatch ) : true Update the route associated with a controller service
updateSelector ( string $controllerService, string $selector ) : true Update the content-negotiation selector for the given service

Protected Methods

Method Description
getNormalizationFilter ( ) : Zend\Filter\FilterChain Retrieve and/or initialize the normalization filter chain
getRouteMatchStringFromModuleConfig ( string $routeName, array $config ) : false | string Retrieve the URL match for the given route name
normalize ( string $string ) : string Normalize a service or module name to lowercase, dash-separated
routeAlreadyExist ( string $route, string $excludeRouteName = null ) : boolean Check if a route already exist in the configuration

Method Details

__construct() public method

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

createContentNegotiationConfig() public method

Create the selector configuration
public createContentNegotiationConfig ( string $controllerService, string $selector = null ) : array
$controllerService string
$selector string
return array

createController() public method

Create a controller in the current module named for the given service
public createController ( string $serviceName ) : object | false
$serviceName string
return object | false

createFactoryController() public method

public createFactoryController ( string $serviceName ) : boolean | string
$serviceName string
return boolean | string

createMediaType() public method

Based on the module and the latest module version.
public createMediaType ( ) : string
return string

createRoute() public method

Create the route configuration
public createRoute ( string $route, string $serviceName, string $controllerService = null ) : string
$route string
$serviceName string
$controllerService string
return string The newly created route name

createRpcConfig() public method

Create the zf-rpc configuration for the controller service
public createRpcConfig ( string $serviceName, string $controllerService, string $routeName, array $httpMethods = ['GET'], null | string | callable $callable = null ) : array
$serviceName string
$controllerService string
$routeName string
$httpMethods array
$callable null | string | callable
return array

createService() public method

Creates the controller and all configuration, returning the full configuration as a tree.
public createService ( string $serviceName, string $routeMatch, array $httpMethods, null | string $selector = null ) : RpcServiceEntity
$serviceName string
$routeMatch string
$httpMethods array
$selector null | string
return RpcServiceEntity

deleteAuthorizationConfig() public method

Delete authorization configuration associated with a service
public deleteAuthorizationConfig ( string $serviceName )
$serviceName string

deleteContentNegotiationConfig() public method

Delete the Content Negotiation configuration for a named RPC service
public deleteContentNegotiationConfig ( string $serviceName )
$serviceName string

deleteContentValidationConfig() public method

Delete content-validation configuration associated with a service
public deleteContentValidationConfig ( string $serviceName )
$serviceName string

deleteControllersConfig() public method

Remove any controller service configuration for a service
public deleteControllersConfig ( string $serviceName )
$serviceName string

deleteRouteConfig() public method

Removes the route configuration for a named route
public deleteRouteConfig ( string $routeName, string $serviceName )
$routeName string
$serviceName string

deleteRpcConfig() public method

Delete the RPC configuration for a named RPC service
public deleteRpcConfig ( string $serviceName )
$serviceName string

deleteService() public method

Delete a service
public deleteService ( RpcServiceEntity $entity, boolean $recursive = false ) : true
$entity RpcServiceEntity
$recursive boolean
return true

deleteVersioningConfig() public method

Only for version 1; later versions will do nothing
public deleteVersioningConfig ( string $routeName, string $serviceName )
$routeName string
$serviceName string

fetch() public method

Fetch a single RPC service
public fetch ( string $controllerServiceName ) : RpcServiceEntity | false
$controllerServiceName string
return RpcServiceEntity | false

fetchAll() public method

Fetch all services
public fetchAll ( integer $version = null ) : RpcServiceEntity[]
$version integer
return RpcServiceEntity[]

getNormalizationFilter() protected method

Retrieve and/or initialize the normalization filter chain
protected getNormalizationFilter ( ) : Zend\Filter\FilterChain
return Zend\Filter\FilterChain

getRouteMatchStringFromModuleConfig() protected method

Retrieve the URL match for the given route name
protected getRouteMatchStringFromModuleConfig ( string $routeName, array $config ) : false | string
$routeName string
$config array
return false | string

normalize() protected method

Normalize a service or module name to lowercase, dash-separated
protected normalize ( string $string ) : string
$string string
return string

routeAlreadyExist() protected method

Check if a route already exist in the configuration
protected routeAlreadyExist ( string $route, string $excludeRouteName = null ) : boolean
$route string
$excludeRouteName string
return boolean

updateContentNegotiationWhitelist() public method

Update configuration for a content negotiation whitelist for a named controller service
public updateContentNegotiationWhitelist ( string $controllerService, string $headerType, array $whitelist ) : true
$controllerService string
$headerType string
$whitelist array
return true

updateHttpMethods() public method

Update the allowed HTTP methods for a given service
public updateHttpMethods ( string $controllerService, array $httpMethods ) : true
$controllerService string
$httpMethods array
return true

updateRoute() public method

Update the route associated with a controller service
public updateRoute ( string $controllerService, string $routeMatch ) : true
$controllerService string
$routeMatch string
return true

updateSelector() public method

Update the content-negotiation selector for the given service
public updateSelector ( string $controllerService, string $selector ) : true
$controllerService string
$selector string
return true

Property Details

$configResource protected_oe property

protected ConfigResource,ZF\Configuration $configResource
return ZF\Configuration\ConfigResource

$filter protected_oe property

protected FilterChain,Zend\Filter $filter
return Zend\Filter\FilterChain

$module protected_oe property

protected string $module
return string

$moduleEntity protected_oe property

protected ModuleEntity,ZF\Apigility\Admin\Model $moduleEntity
return ModuleEntity

$modules protected_oe property

protected ModulePathSpec,ZF\Apigility\Admin\Model $modules
return ModulePathSpec