PHP Class Efficiently\AuthorityController\ControllerResource

Show file Open project: efficiently/authority-controller Class Usage Examples

Protected Properties

Property Type Description
$controller
$name
$options
$params

Public Methods

Method Description
__construct ( $controller, $name = null, $options = [] )
addBeforeFilter ( $controller, $method, $args )
authorizeResource ( )
getCollectionScopeWithParams ( )
getNameByController ( $controller )
isParent ( )
loadAndAuthorizeResource ( )
loadResource ( )

Protected Methods

Method Description
buildResource ( )
extractKey ( $value )
fetchParent ( $name )
findResource ( )
getAuthorizationAction ( )
getCollectionActions ( )
getCollectionInstance ( )
getCollectionScope ( )
getCreateActions ( ) And the Rails 'create' action is named 'store' in Laravel.
getCurrentAbility ( ) Alias of getCurrentAuthority() to match CanCan API
getCurrentAuthority ( )
getIdKey ( )
getIdParam ( )
getInstanceName ( )
getName ( )
getNameFromController ( )
getNamespace ( $controllerName = null )
getNamespacedName ( )
getNewActions ( ) Alias of getCreateActions() to match CanCan API
getParentName ( )
getParentResource ( ) The object to load this resource through.
getResourceBase ( ) The object that methods (such as "find", "new" or "build") are called on.
getResourceClass ( ) only be used for authorization, not loading since there's no class to load through.
getResourceClassWithParent ( )
getResourceInstance ( )
getResourceParams ( )
getResourceParamsByNamespacedName ( )
getResourcePrimaryKey ( )
isMemberAction ( )
loadCollection ( )
loadResourceInstance ( )
loadedCollection ( )
loadedInstance ( )
setAttributes ( $resource )
setCollectionInstance ( $instance )
setResourceInstance ( $instance )

Method Details

__construct() public method

public __construct ( $controller, $name = null, $options = [] )

addBeforeFilter() public static method

public static addBeforeFilter ( $controller, $method, $args )

authorizeResource() public method

public authorizeResource ( )

buildResource() protected method

protected buildResource ( )

extractKey() protected method

protected extractKey ( $value )

fetchParent() protected method

protected fetchParent ( $name )

findResource() protected method

protected findResource ( )

getAuthorizationAction() protected method

protected getAuthorizationAction ( )

getCollectionActions() protected method

protected getCollectionActions ( )

getCollectionInstance() protected method

protected getCollectionInstance ( )

getCollectionScope() protected method

protected getCollectionScope ( )

getCollectionScopeWithParams() public method

getCreateActions() protected method

And the Rails 'create' action is named 'store' in Laravel.
protected getCreateActions ( )

getCurrentAbility() protected method

Alias of getCurrentAuthority() to match CanCan API
protected getCurrentAbility ( )

getCurrentAuthority() protected method

protected getCurrentAuthority ( )

getIdKey() protected method

protected getIdKey ( )

getIdParam() protected method

protected getIdParam ( )

getInstanceName() protected method

protected getInstanceName ( )

getName() protected method

protected getName ( )

getNameByController() public static method

public static getNameByController ( $controller )

getNameFromController() protected method

protected getNameFromController ( )

getNamespace() protected method

protected getNamespace ( $controllerName = null )

getNamespacedName() protected method

protected getNamespacedName ( )

getNewActions() protected method

Alias of getCreateActions() to match CanCan API
protected getNewActions ( )

getParentName() protected method

protected getParentName ( )

getParentResource() protected method

The object to load this resource through.
protected getParentResource ( )

getResourceBase() protected method

If the 'through' option is passed it will go through an association on that instance. If the 'shallow' option is passed it will use the getResourceClass() method if there's no parent If the 'singleton' option is passed it won't use the association because it needs to be handled later.
protected getResourceBase ( )

getResourceClass() protected method

only be used for authorization, not loading since there's no class to load through.
protected getResourceClass ( )

getResourceClassWithParent() protected method

getResourceInstance() protected method

protected getResourceInstance ( )

getResourceParams() protected method

protected getResourceParams ( )

getResourceParamsByNamespacedName() protected method

getResourcePrimaryKey() protected method

protected getResourcePrimaryKey ( )

isMemberAction() protected method

protected isMemberAction ( )

isParent() public method

public isParent ( )

loadAndAuthorizeResource() public method

loadCollection() protected method

protected loadCollection ( )

loadResource() public method

public loadResource ( )

loadResourceInstance() protected method

protected loadResourceInstance ( )

loadedCollection() protected method

protected loadedCollection ( )

loadedInstance() protected method

protected loadedInstance ( )

setAttributes() protected method

protected setAttributes ( $resource )

setCollectionInstance() protected method

protected setCollectionInstance ( $instance )

setResourceInstance() protected method

protected setResourceInstance ( $instance )

Property Details

$controller protected property

protected $controller

$name protected property

protected $name

$options protected property

protected $options

$params protected property

protected $params