Documentation

FlexDirectory
in package
implements FlexDirectoryInterface uses FlexAuthorizeTrait

Class FlexDirectory

Table of Contents

Interfaces

FlexDirectoryInterface
Interface FlexDirectoryInterface

Properties

$blueprint_file  : string
$blueprints  : array<string|int, Blueprint>
$cache  : array<string|int, CacheInterface>
$collection  : FlexCollectionInterface|null
$collectionClassName  : string
$config  : Config
$defaults  : array<string|int, mixed>
$enabled  : bool
$indexClassName  : string
$indexes  : array<string|int, FlexIndexInterface>
$objectClassName  : string
$objects  : array<string|int, FlexObjectInterface>
$storage  : FlexStorageInterface
$type  : string
$_authorize  : string|null

Methods

__construct()  : mixed
FlexDirectory constructor.
clearCache()  : $this
createCollection()  : FlexCollectionInterface
createIndex()  : FlexIndexInterface
createObject()  : FlexObjectInterface
getAuthorizeRule()  : string
getBlueprint()  : Blueprint
Returns a new uninitialized instance of blueprint.
getBlueprintFile()  : string
getCache()  : CacheInterface
getCollection()  : FlexCollectionInterface
Get collection. In the site this will be filtered by the default filters (published etc).
getCollectionClass()  : string
getConfig()  : mixed
getDescription()  : string
getDirectoryConfigUri()  : string
getFlexType()  : string
getIndex()  : FlexIndexInterface
Get the full collection of all stored objects.
getIndexClass()  : string
getMediaFolder()  : string|null
getObject()  : FlexObjectInterface|null
Returns an object if it exists. If no arguments are passed (or both of them are null), method creates a new empty object.
getObjectClass()  : string
getSearchOptions()  : array<string|int, mixed>
getSearchProperties()  : array<string|int, mixed>
getStorage()  : FlexStorageInterface
getStorageFolder()  : string|null
getTitle()  : string
getType()  : string
isAuthorized()  : bool|null
Check if user is authorized for the action.
isEnabled()  : bool
isListed()  : bool
loadCollection()  : FlexCollectionInterface
reloadIndex()  : void
remove()  : FlexObjectInterface|null
update()  : FlexObjectInterface
createStorage()  : FlexStorageInterface
dynamicAuthorizeField()  : void
dynamicDataField()  : void
dynamicFlexField()  : void
getActiveUser()  : UserInterface|null
getAuthorizeAction()  : string
getAuthorizeScope()  : string
getBlueprintInternal()  : Blueprint
getDirectoryConfig()  : array<string|int, mixed>
isAuthorizedAction()  : bool|null
Check if user is authorized for the action.
isAuthorizedOverride()  : bool|null
Please override this method
isAuthorizedSuperAdmin()  : bool|null
loadCachedObjects()  : array<string|int, mixed>
loadIndex()  : FlexIndexInterface
mergeArrays()  : array<string|int, mixed>

Properties

Methods

__construct()

FlexDirectory constructor.

public __construct(string $type, string $blueprint_file[, array<string|int, mixed> $defaults = [] ]) : mixed
Parameters
$type : string
$blueprint_file : string
$defaults : array<string|int, mixed> = []

clearCache()

public clearCache() : $this
Return values
$this

createCollection()

public createCollection(array<string|int, mixed> $entries[, string|null $keyField = null ]) : FlexCollectionInterface
Parameters
$entries : array<string|int, mixed>
$keyField : string|null = null
Tags
phpstan-return

FlexCollectionInterface<FlexObjectInterface>

Return values
FlexCollectionInterface

createIndex()

public createIndex(array<string|int, mixed> $entries[, string|null $keyField = null ]) : FlexIndexInterface
Parameters
$entries : array<string|int, mixed>
$keyField : string|null = null
Tags
phpstan-return

FlexIndexInterface<FlexObjectInterface>

Return values
FlexIndexInterface

createObject()

public createObject(array<string|int, mixed> $data[, string $key = '' ][, bool $validate = false ]) : FlexObjectInterface
Parameters
$data : array<string|int, mixed>
$key : string = ''
$validate : bool = false
Return values
FlexObjectInterface

getAuthorizeRule()

public getAuthorizeRule(string $scope, string $action) : string
Parameters
$scope : string
$action : string
Return values
string

getBlueprint()

Returns a new uninitialized instance of blueprint.

public getBlueprint([string $type = '' ][, string $context = '' ]) : Blueprint

Always use $object->getBlueprint() or $object->getForm()->getBlueprint() instead.

Parameters
$type : string = ''
$context : string = ''
Return values
Blueprint

getBlueprintFile()

public getBlueprintFile([string $view = '' ]) : string
Parameters
$view : string = ''
Return values
string

getCollection()

Get collection. In the site this will be filtered by the default filters (published etc).

public getCollection([array<string|int, mixed>|null $keys = null ][, string|null $keyField = null ]) : FlexCollectionInterface

Use $directory->getIndex() if you want unfiltered collection.

Parameters
$keys : array<string|int, mixed>|null = null

Array of keys.

$keyField : string|null = null

Field to be used as the key.

Tags
phpstan-return

FlexCollectionInterface<FlexObjectInterface>

Return values
FlexCollectionInterface

getCollectionClass()

public getCollectionClass() : string
Return values
string

getConfig()

public getConfig([string|null $name = null ][, mixed $default = null ]) : mixed
Parameters
$name : string|null = null
$default : mixed = null

getDescription()

public getDescription() : string
Return values
string

getDirectoryConfigUri()

public getDirectoryConfigUri([string|null $name = null ]) : string
Parameters
$name : string|null = null
Return values
string

getFlexType()

public getFlexType() : string
Return values
string

getIndex()

Get the full collection of all stored objects.

public getIndex([array<string|int, mixed>|null $keys = null ][, string|null $keyField = null ]) : FlexIndexInterface

Use $directory->getCollection() if you want a filtered collection.

Parameters
$keys : array<string|int, mixed>|null = null

Array of keys.

$keyField : string|null = null

Field to be used as the key.

Tags
phpstan-return

FlexIndexInterface<FlexObjectInterface>

Return values
FlexIndexInterface

getIndexClass()

public getIndexClass() : string
Return values
string

getMediaFolder()

public getMediaFolder([string|null $key = null ]) : string|null
Parameters
$key : string|null = null
Return values
string|null

getObject()

Returns an object if it exists. If no arguments are passed (or both of them are null), method creates a new empty object.

public getObject([string|null $key = null ][, string|null $keyField = null ]) : FlexObjectInterface|null

Note: It is not safe to use the object without checking if the user can access it.

Parameters
$key : string|null = null
$keyField : string|null = null

Field to be used as the key.

Return values
FlexObjectInterface|null

getObjectClass()

public getObjectClass() : string
Return values
string

getSearchOptions()

public getSearchOptions([array<string|int, mixed>|null $options = null ]) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed>|null = null
Return values
array<string|int, mixed>

getSearchProperties()

public getSearchProperties([string|array<string|int, string>|null $properties = null ]) : array<string|int, mixed>
Parameters
$properties : string|array<string|int, string>|null = null
Return values
array<string|int, mixed>

getStorageFolder()

public getStorageFolder([string|null $key = null ]) : string|null
Parameters
$key : string|null = null
Return values
string|null

getType()

public getType() : string

Use ->getFlexType() method instead.

Return values
string

isAuthorized()

Check if user is authorized for the action.

public isAuthorized(string $action[, string|null $scope = null ][, UserInterface|null $user = null ]) : bool|null

Note: There are two deny values: denied (false), not set (null). This allows chaining multiple rules together when the previous rules were not matched.

To override the default behavior, please use isAuthorizedOverride().

Parameters
$action : string
$scope : string|null = null
$user : UserInterface|null = null
Tags
final
Return values
bool|null

loadCollection()

public loadCollection(array<string|int, mixed> $entries[, string|null $keyField = null ]) : FlexCollectionInterface
Parameters
$entries : array<string|int, mixed>
$keyField : string|null = null
Tags
phpstan-return

FlexCollectionInterface<FlexObjectInterface>

Return values
FlexCollectionInterface

update()

public update(array<string|int, mixed> $data[, string|null $key = null ]) : FlexObjectInterface

Use $object->update()->save() instead.

Parameters
$data : array<string|int, mixed>
$key : string|null = null
Return values
FlexObjectInterface

dynamicAuthorizeField()

protected dynamicAuthorizeField(array<string|int, mixed> &$field, string $property, array<string|int, mixed> $call) : void
Parameters
$field : array<string|int, mixed>
$property : string
$call : array<string|int, mixed>

dynamicDataField()

protected dynamicDataField(array<string|int, mixed> &$field, string $property, array<string|int, mixed> $call) : void
Parameters
$field : array<string|int, mixed>
$property : string
$call : array<string|int, mixed>

dynamicFlexField()

protected dynamicFlexField(array<string|int, mixed> &$field, string $property, array<string|int, mixed> $call) : void
Parameters
$field : array<string|int, mixed>
$property : string
$call : array<string|int, mixed>

getAuthorizeAction()

protected getAuthorizeAction(string $action) : string
Parameters
$action : string
Return values
string

getAuthorizeScope()

protected getAuthorizeScope() : string
Return values
string

getBlueprintInternal()

protected getBlueprintInternal([string $type_view = '' ][, string $context = '' ]) : Blueprint
Parameters
$type_view : string = ''
$context : string = ''
Return values
Blueprint

getDirectoryConfig()

protected getDirectoryConfig([string|null $name = null ]) : array<string|int, mixed>
Parameters
$name : string|null = null
Return values
array<string|int, mixed>

isAuthorizedAction()

Check if user is authorized for the action.

protected isAuthorizedAction(UserInterface $user, string $action, string $scope, bool $isMe) : bool|null
Parameters
$user : UserInterface
$action : string
$scope : string
$isMe : bool
Return values
bool|null

isAuthorizedOverride()

Please override this method

protected isAuthorizedOverride(UserInterface $user, string $action, string $scope, bool $isMe) : bool|null
Parameters
$user : UserInterface
$action : string
$scope : string
$isMe : bool
Return values
bool|null

loadCachedObjects()

protected loadCachedObjects(array<string|int, mixed> $fetch) : array<string|int, mixed>
Parameters
$fetch : array<string|int, mixed>
Return values
array<string|int, mixed>

mergeArrays()

protected mergeArrays(array<string|int, mixed> $array1, array<string|int, mixed> $array2) : array<string|int, mixed>
Parameters
$array1 : array<string|int, mixed>
$array2 : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results