Transformable
Zemit\Mvc\Model\Traits\Behavior\Transformable
Allows to automatically update a model’s attribute saving the datetime when a record is created or updated
- Full name:
\Zemit\Mvc\Model\Behavior\Transformable
- Parent class:
Behavior
Methods
notify
Listens for notifications from the models manager
public notify(string $type, \Phalcon\Mvc\ModelInterface $model): ?bool
Parameters:
Parameter | Type | Description |
---|---|---|
$type | string | |
$model | \Phalcon\Mvc\ModelInterface |
Inherited methods
getEnabled
Return true if the behavior is enabled on the current model instance
public getEnabled(): bool
setEnabled
Set true to enable the behavior on the current model instance
public setEnabled(bool $enabled): void
Parameters:
Parameter | Type | Description |
---|---|---|
$enabled | bool |
getStaticEnabled
Return true if the behavior is enabled globally for every model instance
public static getStaticEnabled(): bool
- This method is static.
setStaticEnabled
Set true to enable the behavior globally for every model instance
public static setStaticEnabled(bool $staticEnabled): void
- This method is static.
Parameters:
Parameter | Type | Description |
---|---|---|
$staticEnabled | bool |
enable
Enable the behavior on the current model instance
public enable(): void
disable
Disable the behavior on the current model instance
public disable(): void
staticEnable
Enable the behavior globally for every model instance
public static staticEnable(): void
- This method is static.
staticDisable
Disable the behavior globally for every model instance
public static staticDisable(): void
- This method is static.
isEnabled
Return true if the behavior is enabled on the current model instance and globally
public isEnabled(): bool
isDisabled
Return true if the behavior is enabled on the current model instance and globally
public isDisabled(): bool