PHP Class yii2tech\admin\behaviors\action\VariationBehavior

This behavior should be attached to Action instance. This behavior relies on events triggered by ModelFormTrait.
See also: https://github.com/yii2tech/ar-variation
See also: yii2tech\admin\actions\ModelFormTrait
Since: 1.0
Author: Paul Klimov ([email protected])
Inheritance: extends yii\base\Behavior
Afficher le fichier Open project: yii2tech/admin Class Usage Examples

Méthodes publiques

Свойство Type Description
$variationNames list of model variation behavior names, which should be affected by the action. If empty - all instances of [[\yii2tech\ar\variation\VariationBehavior]] will be picked up.

Méthodes publiques

Méthode Description
afterDataLoad ( ActionEvent $event ) Handles afterDataLoad event.
events ( )

Méthodes protégées

Méthode Description
afterAjaxValidate ( ActionEvent $event ) Handles afterAjaxValidate event.
findVariationModelBatches ( Model | yii\db\ActiveRecordInterface $model ) : array
getVariationModelBatches ( Model | yii\db\ActiveRecordInterface $model ) : array Get variation models for the main one in batches.

Method Details

afterAjaxValidate() protected méthode

Performs AJAX validation of the variation models via [[ActiveForm::validate()]].
protected afterAjaxValidate ( ActionEvent $event )
$event yii2tech\admin\ActionEvent event instance.

afterDataLoad() public méthode

Populates the variation models with input data.
public afterDataLoad ( ActionEvent $event )
$event yii2tech\admin\ActionEvent event instance.

events() public méthode

public events ( )

findVariationModelBatches() protected méthode

protected findVariationModelBatches ( Model | yii\db\ActiveRecordInterface $model ) : array
$model yii\base\Model | yii\db\ActiveRecordInterface
Résultat array list of variation models in format: behaviorName => Model[]

getVariationModelBatches() protected méthode

Get variation models for the main one in batches.
protected getVariationModelBatches ( Model | yii\db\ActiveRecordInterface $model ) : array
$model yii\base\Model | yii\db\ActiveRecordInterface main model instance.
Résultat array list of variation models in format: behaviorName => Model[]

Property Details

$variationNames public_oe property

list of model variation behavior names, which should be affected by the action. If empty - all instances of [[\yii2tech\ar\variation\VariationBehavior]] will be picked up.
public $variationNames