Documentation

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

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>

addDirectoryType()

public addDirectoryType(string $type, string $blueprint[, array<string|int, mixed> $config = [] ]) : $this
Parameters
$type : string
$blueprint : string
$config : array<string|int, mixed> = []
Return values
$this

count()

public count() : int
Return values
int

getCollection()

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
phpstan-return

FlexCollectionInterface<FlexObjectInterface>|null

Return values
FlexCollectionInterface|null

getDirectories()

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>

getMixedCollection()

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
throws
RuntimeException
phpstan-return

FlexCollectionInterface<FlexObjectInterface>

Return values
FlexCollectionInterface

getObject()

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|null

getObjects()

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
bool

resolveKeyAndType()

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
Return values
string

        
On this page

Search results