\Charcoal\Admin\Widget\CmsSectionTableTrait

Summary

Methods
Properties
Constants
sectionFactory()
No public properties found
No constants found
setSectionFactory()
parsePropertyCell()
No protected properties found
N/A
abridgeUri()
abridgeStr()
$sectionFactory
N/A

Properties

$sectionFactory

$sectionFactory : \Charcoal\Factory\FactoryInterface

Store the factory instance for the current class.

Type

\Charcoal\Factory\FactoryInterface

Methods

sectionFactory()

sectionFactory() : \Charcoal\Factory\FactoryInterface

Retrieve the object model factory.

Throws

\RuntimeException

If the model factory was not previously set.

Returns

\Charcoal\Factory\FactoryInterface

setSectionFactory()

setSectionFactory(\Charcoal\Factory\FactoryInterface  $factory) : self

Set an object model factory.

Parameters

\Charcoal\Factory\FactoryInterface $factory

The model factory, to create objects.

Returns

self

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

abridgeUri()

abridgeUri(string  $uri) : string

Retrieve an abridged variant to the given URI.

Parameters

string $uri

A URI to possibly truncate.

Returns

string

abridgeStr()

abridgeStr(string  $str, integer  $l = 30, integer  $a = 12, integer  $z = 12) : string

Retrieve an abridged variant to the given URI.

Parameters

string $str

The string to possibly truncate.

integer $l

Optional. The soft-limit of the string.

integer $a

Optional. The hard-limit to keep from the beginning of the string.

integer $z

Optional. The hard-limit to keep from the end of the string.

Returns

string