tableName() public méthode

public tableName ( ) : string
Résultat string the associated database table name
 public function testTableNameByThis()
 {
     $post = new Post();
     $table_name = $post->tableName();
     $this->assertSame($table_name, 'post');
 }
Exemple #2
0
 /**
  * @return \common\models\cms\PostQuery
  */
 public function active()
 {
     $this->andWhere([Post::tableName() . '.status' => 1, Post::tableName() . '.deleted' => 0]);
     //双[[]]表示and
     return $this;
 }