public function active($withClient = true) { $this->andWhere([Location::tableName() . '.active' => true]); if ($withClient) { $this->joinWith('client')->andWhere([Client::tableName() . '.active' => true])->orderBy([Client::tableName() . '.name' => SORT_ASC, Location::tableName() . '.name' => SORT_ASC]); } /*else { $this->orderBy('name'); }*/ return $this; }
public function testTableNameForStiModels() { $client = new Client(); $this->assertEquals('users', $client->tableName()); }