0 follower

Abstract Class Yiisoft\ActiveRecord\Event\Handler\AttributeHandlerProvider

InheritanceYiisoft\ActiveRecord\Event\Handler\AttributeHandlerProvider
SubclassesYiisoft\ActiveRecord\Event\Handler\DefaultDateTimeOnInsert, Yiisoft\ActiveRecord\Event\Handler\DefaultValue, Yiisoft\ActiveRecord\Event\Handler\DefaultValueOnInsert, Yiisoft\ActiveRecord\Event\Handler\SetDateTimeOnUpdate, Yiisoft\ActiveRecord\Event\Handler\SetValueOnUpdate, Yiisoft\ActiveRecord\Event\Handler\SoftDelete

Abstract class for event handlers provider based on class attributes.

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Yiisoft\ActiveRecord\Event\Handler\AttributeHandlerProvider
getEventHandlers() Returns array with event class names as keys and their handlers as values [event_class => handler_closure, ...] Yiisoft\ActiveRecord\Event\Handler\AttributeHandlerProvider
getPropertyNames() Returns the list of property names the handler should be applied to. Yiisoft\ActiveRecord\Event\Handler\AttributeHandlerProvider
setPropertyNames() Sets the list of property names the handler should be applied to. Yiisoft\ActiveRecord\Event\Handler\AttributeHandlerProvider

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( string $propertyNames )
$propertyNames string

Names of properties the handler should be applied to.

                public function __construct(
    string ...$propertyNames,
) {
    $this->propertyNames = $propertyNames;
}

            
getEventHandlers() public abstract method

Returns array with event class names as keys and their handlers as values [event_class => handler_closure, ...]

public abstract array getEventHandlers ( )

                abstract public function getEventHandlers(): array;

            
getPropertyNames() public method

Returns the list of property names the handler should be applied to.

public string[] getPropertyNames ( )

                public function getPropertyNames(): array
{
    return $this->propertyNames;
}

            
setPropertyNames() public method

Sets the list of property names the handler should be applied to.

public void setPropertyNames ( string[] $propertyNames )
$propertyNames string[]

                public function setPropertyNames(array $propertyNames): void
{
    $this->propertyNames = $propertyNames;
}