\Bazalt\ORM\PluginSerializable

Serializable Плагін, що надає змогу автоматично серіалізувати поля в базі даних

Summary

Methods
Properties
Constants
init()
getPlugin()
initForModel()
getOptions()
toArray()
onGet()
onSet()
No public properties found
No constants found
initFields()
initRelations()
initPlugins()
__construct()
initPlugin()
$allPlugins
N/A
No private methods found
$_options
N/A

Properties

$allPlugins

$allPlugins : array

All loaded plugins

Type

array

$_options

$_options : array

Options of all plugins

Type

array

Methods

init()

init(\Bazalt\ORM\Record  $model, array  $options) : void

Ініціалізує плагін

Parameters

\Bazalt\ORM\Record $model

Модель, для якої викликано initFields

array $options

Масив опцій, передається з базової моделі при ініціалізації плагіна

getPlugin()

getPlugin(string  $name) : \Bazalt\ORM\Plugin\AbstractPlugin

Return plugin by name

Parameters

string $name

Name of plugin

Throws

\Bazalt\ORM\Plugin\Exception

Returns

\Bazalt\ORM\Plugin\AbstractPlugin

Plugin

initForModel()

initForModel(\Bazalt\ORM\Record  $model, array  $options) : void

Init plugin for model

Parameters

\Bazalt\ORM\Record $model

Record

array $options

Options for plugin

getOptions()

getOptions() : array

Get plugin options

Returns

array —

Options

toArray()

toArray(\Bazalt\ORM\Record  $record,   $itemArray,   $options) 

Parameters

\Bazalt\ORM\Record $record
$itemArray
$options

onGet()

onGet(\Bazalt\ORM\Record  $record, string  $field,   $return) : void

Хендлер на евент onGet моделей які юзають плагін.

Евент запалюється при виклику __get() для поля і повертає десеріалізоване значення

Parameters

\Bazalt\ORM\Record $record

Поточний запис

string $field

Поле для якого викликається __get()

$return

onSet()

onSet(\Bazalt\ORM\Record  $record, string  $field, string  $value,   $return) : void

Хендлер на евент onSet моделей які юзають плагін.

Евент запалюється при виклику __set() для поля і встановлює в поле серіалізоване значення

Parameters

\Bazalt\ORM\Record $record

Поточний запис

string $field

Поле для якого викликається __set()

string $value

Значення яке передається в __set()

$return

initFields()

initFields(\Bazalt\ORM\Record  $model, array  $options) : void

Init model fields

Parameters

\Bazalt\ORM\Record $model

Record

array $options

Options for plugin

initRelations()

initRelations(\Bazalt\ORM\Record  $model, array  $options) : void

Init model relations

Parameters

\Bazalt\ORM\Record $model

Record

array $options

Options for plugin

initPlugins()

initPlugins(\Bazalt\ORM\Record  $model, array  $options) : void

Init model plugins

Parameters

\Bazalt\ORM\Record $model

Record

array $options

Options for plugin

__construct()

__construct() 

Constructor

initPlugin()

initPlugin(  $plugin) : void

Init plugin

Parameters

$plugin