Skip to content

SkippableTrait

Allow to enable or disable trait on the current model instance ($enabled) or globally for every model instance ($staticEnabled)

  • Full name: \Zemit\Mvc\Model\Behavior\Traits\SkippableTrait

Properties

enabled

public bool $enabled

staticEnabled

public static bool $staticEnabled
  • This property is static.

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