PHP Класс Bolt\Storage\FieldManager

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$boltConfig Bolt\Config
$customHandlers
$em EntityManager
$handlers
$sanitiser Bolt\Storage\Field\Sanitiser\SanitiserInterface
$typemap

Открытые методы

Метод Описание
__construct ( array $typemap, Config $config, Bolt\Storage\Field\Sanitiser\SanitiserInterface $sanitiser ) Constructor.
addFieldType ( $name, $handler ) Shorthand to add a field to both the new and legacy managers.
get ( $class, $mapping ) : mixed Gets the field instance for the supplied class.
getFieldFor ( $type ) : boolean | mixed Looks up a type from the typemap and returns a field class.
hasCustomHandler ( $name ) : boolean Note, this method is for Bolt use only, as a way to distinguish which fields have been added outside of the core system. It will be removed in a future version.
setEntityManager ( EntityManager $em = null ) Set an instance of EntityManager
setHandler ( $class, callable | object $handler ) Links the field name found in the config to a callable handler.

Описание методов

__construct() публичный Метод

Requires access to legacy Config class so that it can add fields to the old-style manager This can be removed once the templating has migrated to the new system.
public __construct ( array $typemap, Config $config, Bolt\Storage\Field\Sanitiser\SanitiserInterface $sanitiser )
$typemap array
$config Bolt\Config
$sanitiser Bolt\Storage\Field\Sanitiser\SanitiserInterface

addFieldType() публичный Метод

Shorthand to add a field to both the new and legacy managers.
public addFieldType ( $name, $handler )
$name
$handler

get() публичный Метод

Gets the field instance for the supplied class.
public get ( $class, $mapping ) : mixed
$class
$mapping
Результат mixed

getFieldFor() публичный Метод

Looks up a type from the typemap and returns a field class.
public getFieldFor ( $type ) : boolean | mixed
$type
Результат boolean | mixed

hasCustomHandler() публичный Метод

Note, this method is for Bolt use only, as a way to distinguish which fields have been added outside of the core system. It will be removed in a future version.
public hasCustomHandler ( $name ) : boolean
$name
Результат boolean

setEntityManager() публичный Метод

Set an instance of EntityManager
public setEntityManager ( EntityManager $em = null )
$em EntityManager

setHandler() публичный Метод

Links the field name found in the config to a callable handler.
public setHandler ( $class, callable | object $handler )
$class
$handler callable | object

Описание свойств

$boltConfig защищенное свойство

protected Config,Bolt $boltConfig
Результат Bolt\Config

$customHandlers защищенное свойство

protected $customHandlers

$em защищенное свойство

protected EntityManager,Bolt\Storage $em
Результат EntityManager

$handlers защищенное свойство

protected $handlers

$sanitiser защищенное свойство

protected SanitiserInterface,Bolt\Storage\Field\Sanitiser $sanitiser
Результат Bolt\Storage\Field\Sanitiser\SanitiserInterface

$typemap защищенное свойство

protected $typemap