title: Get model by table name in yii2
body: <p>I have one method in several models, implemented in different ways.
  I only know the name of table in database. I must find model of this table. 
  How to do?</p>
  
  <pre><code>interface BaseIndexedModel
  {
      public function writeSometext();
  }
  </code></pre>
  
  <p>and some models implement it. Example</p>
  
  <pre><code>class First extends \yii\db\ActiveRecord implements BaseIndexedModel
  {
      public function writeSometext(){
         return "1";
      }
  }
  
  class Second extends \yii\db\ActiveRecord implements BaseIndexedModel
  {
      public function writeSometext(){
         return "2";
      }
  }
  </code></pre>
  
  <p>Next on a certain event I need to call the desired model and this method. But when I call, I will only know the database table, but not the model.</p>
  
  <p>If table "first", <code>First::writeSometext();</code>
  If table "second", <code>Second:: writeSometext();</code></p>