yii\db\ActiveQuery::init PHP Method

init() public method

This method is called at the end of the constructor. The default implementation will trigger an [[EVENT_INIT]] event. If you override this method, make sure you call the parent implementation at the end to ensure triggering of the event.
public init ( )
    public function init()
    {
        parent::init();
        $this->trigger(self::EVENT_INIT);
    }

Usage Example

Ejemplo n.º 1
0
 public function init()
 {
     $modelClass = $this->modelClass;
     $tableName = $modelClass::tableName();
     //        $this->andWhere([$tableName.'.active' => 1]);
     $this->orderBy('position');
     parent::init();
 }
All Usage Examples Of yii\db\ActiveQuery::init