title: Yii2 Override find() to add default condition globally
body: <p>I have to override the method using </p>
  
  <pre><code>namespace common\models;
  use Yii;
  use yii\db\ActiveQuery;
  
  class Addfindcondition extends ActiveQuery
  {
  
      public function init()
      {
  
          $this-&gt;andOnCondition([$this-&gt;modelClass::tableName() . '.branch_id' =&gt; Yii::$app-&gt;user-&gt;identity-&gt;branch_id ]);
          parent::init();
      }
  }
  </code></pre>
  
  <p>And call the method in each model separately like this</p>
  
  <pre><code>public static function find()
  {
      return new Addfindcondition(get_called_class());
  }
  </code></pre>
  
  <p>Now I want to override the find method globally. How it is possible that I dont need to use this static method in each model</p>