Flex
in package
implements
FlexInterface
Class Flex
Table of Contents
Interfaces
- FlexInterface
- Interface FlexInterface
Properties
- $config : array<string|int, mixed>
- $types : array<string|int, FlexDirectory>
Methods
- __construct() : mixed
- Flex constructor.
- addDirectory() : $this
- addDirectoryType() : $this
- count() : int
- getCollection() : FlexCollectionInterface|null
- getDirectories() : array<string|int, FlexDirectory|null>
- getDirectory() : FlexDirectory|null
- getMixedCollection() : FlexCollectionInterface
- getObject() : FlexObjectInterface|null
- getObjects() : array<string|int, mixed>
- hasDirectory() : bool
- resolveKeyAndType() : array<string|int, mixed>
- resolveType() : string
Properties
$config
protected
array<string|int, mixed>
$config
$types
protected
array<string|int, FlexDirectory>
$types
Methods
__construct()
Flex constructor.
public
__construct(array<string|int, mixed> $types, array<string|int, mixed> $config) : mixed
Parameters
- $types : array<string|int, mixed>
-
List of [type => blueprint file, ...]
- $config : array<string|int, mixed>
addDirectory()
public
addDirectory(FlexDirectory $directory) : $this
Parameters
- $directory : FlexDirectory
Return values
$thisaddDirectoryType()
public
addDirectoryType(string $type, string $blueprint[, array<string|int, mixed> $config = [] ]) : $this
Parameters
- $type : string
- $blueprint : string
- $config : array<string|int, mixed> = []
Return values
$thiscount()
public
count() : int
Return values
intgetCollection()
public
getCollection(string $type[, array<string|int, mixed>|null $keys = null ][, string|null $keyField = null ]) : FlexCollectionInterface|null
Parameters
- $type : string
- $keys : array<string|int, mixed>|null = null
- $keyField : string|null = null
Tags
Return values
FlexCollectionInterface|nullgetDirectories()
public
getDirectories([array<string|int, mixed>|array<string|int, string>|null $types = null ][, bool $keepMissing = false ]) : array<string|int, FlexDirectory|null>
Parameters
- $types : array<string|int, mixed>|array<string|int, string>|null = null
- $keepMissing : bool = false
Return values
array<string|int, FlexDirectory|null>getDirectory()
public
getDirectory(string $type) : FlexDirectory|null
Parameters
- $type : string
Return values
FlexDirectory|nullgetMixedCollection()
public
getMixedCollection(array<string|int, mixed> $keys[, array<string|int, mixed> $options = [] ]) : FlexCollectionInterface
Parameters
- $keys : array<string|int, mixed>
- $options : array<string|int, mixed> = []
-
In addition to the options in getObjects(), following options can be passed: collection_class: Class to be used to create the collection. Defaults to ObjectCollection.
Tags
Return values
FlexCollectionInterfacegetObject()
public
getObject(string $key[, string|null $type = null ][, string|null $keyField = null ]) : FlexObjectInterface|null
Parameters
- $key : string
- $type : string|null = null
- $keyField : string|null = null
Return values
FlexObjectInterface|nullgetObjects()
public
getObjects(array<string|int, mixed> $keys[, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
- $keys : array<string|int, mixed>
- $options : array<string|int, mixed> = []
-
Following optional options can be passed: types: List of allowed types. type: Allowed type if types isn't defined, otherwise acts as default_type. default_type: Set default type for objects given without type (only used if key_field isn't set). keep_missing: Set to true if you want to return missing objects as null. key_field: Key field which is used to match the objects.
Return values
array<string|int, mixed>hasDirectory()
public
hasDirectory(string $type) : bool
Parameters
- $type : string
Return values
boolresolveKeyAndType()
protected
resolveKeyAndType(string $flexKey[, string|null $type = null ]) : array<string|int, mixed>
Parameters
- $flexKey : string
- $type : string|null = null
Return values
array<string|int, mixed>resolveType()
protected
resolveType([string|null $type = null ]) : string
Parameters
- $type : string|null = null