Final Class Yiisoft\ActiveRecord\Event\BeforeUpdate
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Psr\ |
Event triggered before the record is updated in the database.
It allows modifying properties that will be used for {@see \
See also Yiisoft\
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $model | Yiisoft\ |
Yiisoft\ |
|
| $properties | ?array | Yiisoft\ |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| getReturnValue() | Returns the value that will be returned by the method that triggered this event if the {@see AbstractEvent::isDefaultPrevented() default action is prevented}. | Yiisoft\ |
| isDefaultPrevented() | Checks if the default action associated with this event has been prevented. | Yiisoft\ |
| isPropagationStopped() | Yiisoft\ |
|
| preventDefault() | Prevents the default action associated with this event from being executed. | Yiisoft\ |
| returnValue() | Sets the return value which will be returned by the method that triggered this event if the {@see AbstractEvent::isDefaultPrevented() default action is prevented}. | Yiisoft\ |
| stopPropagation() | Stops the propagation of the event to further listeners. | Yiisoft\ |
Property Details
Method Details
| public mixed __construct ( Yiisoft\ | ||
| $model | Yiisoft\ |
The model being updated. |
| $properties | array|null |
List of property names or name-values pairs that need to be updated.
If name-value pairs are specified, the values will be used for update.
If |
public function __construct(ActiveRecordInterface $model, public ?array &$properties)
{
parent::__construct($model);
}
Defined in:
Yiisoft\
Returns the value that will be returned by the method that triggered this event if the {@see AbstractEvent::isDefaultPrevented() default action is prevented}.
| public mixed getReturnValue ( ) |
public function getReturnValue(): mixed
{
return $this->returnValue;
}
Defined in:
Yiisoft\
Checks if the default action associated with this event has been prevented.
| public boolean isDefaultPrevented ( ) |
public function isDefaultPrevented(): bool
{
return $this->isDefaultPrevented;
}
| public boolean isPropagationStopped ( ) |
public function isPropagationStopped(): bool
{
return $this->isPropagationStopped;
}
Defined in:
Yiisoft\
Prevents the default action associated with this event from being executed.
See also Yiisoft\
| public void preventDefault ( ) |
public function preventDefault(): void
{
$this->isDefaultPrevented = true;
}
Defined in:
Yiisoft\
Sets the return value which will be returned by the method that triggered this event if the {@see AbstractEvent::isDefaultPrevented() default action is prevented}.
See also Yiisoft\
| public void returnValue ( mixed $returnValue ) | ||
| $returnValue | mixed | |
public function returnValue(mixed $returnValue): void
{
$this->returnValue = $returnValue;
}
Defined in:
Yiisoft\
Stops the propagation of the event to further listeners.
No further listeners will be notified after this method is called.
| public void stopPropagation ( ) |
public function stopPropagation(): void
{
$this->isPropagationStopped = true;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.