Properties

$currentObjId

$currentObjId : mixed

Type

mixed

$currentObj

$currentObj : mixed

Type

mixed

$display

$display : \Charcoal\Admin\Ui\PropertyInputInterface

In memory copy of the PropertyDisplay object

Type

\Charcoal\Admin\Ui\PropertyInputInterface

$modelFactory

$modelFactory : \Charcoal\Factory\FactoryInterface

Type

\Charcoal\Factory\FactoryInterface

$collectionLoader

$collectionLoader : \Charcoal\Loader\CollectionLoader

Type

\Charcoal\Loader\CollectionLoader

$objType

$objType : string

Type

string

$collectionIdent

$collectionIdent : string

Type

string

$collectionConfig

$collectionConfig : array|null

Collection configuration.

Type

array|null

$defaultCollectionConfig

$defaultCollectionConfig : array|null

Default collection configuration.

Type

array|null

$numTotal

$numTotal : integer

Type

integer

$collection

$collection : \Charcoal\Model\Collection

Type

\Charcoal\Model\Collection

$propertyDisplayFactory

$propertyDisplayFactory : \Charcoal\Factory\FactoryInterface

Type

\Charcoal\Factory\FactoryInterface

$proto

$proto : \Charcoal\Model\ModelInterface

Type

\Charcoal\Model\ModelInterface

$view

$view : \Charcoal\View\ViewInterface

Type

\Charcoal\View\ViewInterface

Methods

setView()

setView(\Charcoal\View\ViewInterface|array  $view) : \Charcoal\Admin\Ui\CollectionContainerInterface

Parameters

\Charcoal\View\ViewInterface|array $view

The view instance.

Returns

\Charcoal\Admin\Ui\CollectionContainerInterface

Chainable

view()

view() : \Charcoal\View\ViewInterface

Throws

\Exception

If the view instance is not previously set / injected.

Returns

\Charcoal\View\ViewInterface —

The object's view.

setModelFactory()

setModelFactory(\Charcoal\Factory\FactoryInterface  $factory) : \Charcoal\Admin\Ui\CollectionContainerInterface

Parameters

\Charcoal\Factory\FactoryInterface $factory

The model factory, to create model objects.

Returns

\Charcoal\Admin\Ui\CollectionContainerInterface

Chainable

setCollectionLoader()

setCollectionLoader(\Charcoal\Loader\CollectionLoader  $loader) : \Charcoal\Admin\Ui\CollectionContainerInterface

Parameters

\Charcoal\Loader\CollectionLoader $loader

The collection loader.

Returns

\Charcoal\Admin\Ui\CollectionContainerInterface

Chainable

setObjType()

setObjType(string  $objType) : \Charcoal\Admin\Ui\CollectionContainerInterface

Parameters

string $objType

The collection's object type.

Throws

\InvalidArgumentException

If provided argument is not of type 'string'.

Returns

\Charcoal\Admin\Ui\CollectionContainerInterface

Chainable

objType()

objType() : string

Returns

string

setCollectionIdent()

setCollectionIdent(string  $collectionIdent) : \Charcoal\Admin\Ui\CollectionContainerInterface

Set the key for the collection structure to use.

Parameters

string $collectionIdent

The collection identifier.

Throws

\InvalidArgumentException

If the identifier argument is not a string.

Returns

\Charcoal\Admin\Ui\CollectionContainerInterface

Chainable

collectionIdentFallback()

collectionIdentFallback() : string

Retrieve a key for the collection structure to use.

If the collection key is undefined, resolve a fallback.

Returns

string

collectionIdent()

collectionIdent() : string|null

Retrieve the key for the collection structure to use.

Returns

string|null

collectionMetadata()

collectionMetadata() : array

Return the current collection metadata.

Returns

array

collectionConfig()

collectionConfig() : array|null

Retrieve the collection configset.

Returns

array|null

setCollectionConfig()

setCollectionConfig(mixed  $config) : \Charcoal\Admin\Ui\CollectionContainerInterface

Replace the collection's configset with the given parameters.

Parameters

mixed $config

New collection config values.

Returns

\Charcoal\Admin\Ui\CollectionContainerInterface

Chainable

mergeCollectionConfig()

mergeCollectionConfig(array  $config) : self

Merge given parameters into the collection's configset.

Parameters

array $config

New collection config values.

Returns

self

page()

page() : integer

Returns

integer

numPerPage()

numPerPage() : integer

Returns

integer

numPages()

numPages() : integer

Returns

integer

collection()

collection() : \Charcoal\Model\Collection

Returns

\Charcoal\Model\Collection

createCollection()

createCollection(array  $data = null) : \Charcoal\Loader\CollectionLoader

Parameters

array $data

Optional collection data.

Throws

\Exception

If the object type of the colletion has not been set.

Returns

\Charcoal\Loader\CollectionLoader

objects()

objects() : array

Returns

array

sortObjects()

sortObjects() : array

Sort the objects before they are displayed as rows.

This method is useful for classes using this trait.

Returns

array

sortProperties()

sortProperties() : array

Sort the properties before they are displayed as columns.

This method is useful for classes using this trait.

Returns

array

objectRows()

objectRows() : array

Supplies properties for objects in table template specific to object configuration.

Returns

array —

This metod is a generator.

hasObjects()

hasObjects() : boolean

Returns

boolean

numObjects()

numObjects() : integer

Returns

integer

numTotal()

numTotal() : integer

Throws

\Exception

If obj type was not set.

Returns

integer

proto()

proto(boolean  $reload = false) : object

Parameters

boolean $reload

If true, reload will be forced.

Throws

\InvalidArgumentException

If the object type is not defined / can not create prototype.

Returns

object

modelFactory()

modelFactory() : \Charcoal\Factory\FactoryInterface

Model Factory getter.

Throws

\Exception

If the model factory was not previously set.

Returns

\Charcoal\Factory\FactoryInterface

collectionLoader()

collectionLoader() : \Charcoal\Loader\CollectionLoader

Safe Collection Loader getter.

Create the loader if it was not set / injected.

Returns

\Charcoal\Loader\CollectionLoader

createCollectionLoader()

createCollectionLoader() : \Charcoal\Loader\CollectionLoader

Create a collection loader.

Returns

\Charcoal\Loader\CollectionLoader

parseCollectionConfig()

parseCollectionConfig(array  $config) : array

Stub: Parse given parameters into the collection's config set.

Parameters

array $config

New collection config values.

Returns

array

defaultCollectionConfig()

defaultCollectionConfig() : array|null

Retrieve the default collection configuration.

The default configset is determined by the collection ident and object type, if assigned.

Returns

array|null

createCollectionConfig()

createCollectionConfig() : mixed

Stub: reimplement in classes using this trait.

Returns

mixed

setupDisplayPropertyValue()

setupDisplayPropertyValue(\Charcoal\Model\ModelInterface  $object, \Charcoal\Property\PropertyInterface  $property) : void

Setup the property's display value before its assigned to the object row.

This method is useful for classes using this trait.

Parameters

\Charcoal\Model\ModelInterface $object

The current row's object.

\Charcoal\Property\PropertyInterface $property

The current property.

parsePropertyCell()

parsePropertyCell(\Charcoal\Model\ModelInterface  $object, \Charcoal\Property\PropertyInterface  $property, string  $propertyValue) : array

Filter the property before its assigned to the object row.

This method is useful for classes using this trait.

Parameters

\Charcoal\Model\ModelInterface $object

The current row's object.

\Charcoal\Property\PropertyInterface $property

The current property.

string $propertyValue

The property $key's display value.

Returns

array

parseObjectRow()

parseObjectRow(\Charcoal\Model\ModelInterface  $object, array  $objectProperties) : array

Filter the object before its assigned to the row.

This method is useful for classes using this trait.

Parameters

\Charcoal\Model\ModelInterface $object

The current row's object.

array $objectProperties

The $object's display properties.

Returns

array

setPropertyDisplayFactory()

setPropertyDisplayFactory(\Charcoal\Factory\FactoryInterface  $factory) : \Charcoal\Admin\Ui\CollectionContainerInterface

Parameters

\Charcoal\Factory\FactoryInterface $factory

The property display factory.

Returns

\Charcoal\Admin\Ui\CollectionContainerInterface

Chainable

propertyDisplayFactory()

propertyDisplayFactory() : \Charcoal\Factory\FactoryInterface

Throws

\Exception

If the property display factory was not previously injected / set.

Returns

\Charcoal\Factory\FactoryInterface