Fixed scope method signatures

This commit is contained in:
Alexander Makarov
2014-01-17 23:01:13 +04:00
parent 0699eaadd5
commit ed97632f53
3 changed files with 9 additions and 6 deletions

View File

@ -7,9 +7,10 @@ use yii\db\ActiveQuery;
*/
class CustomerQuery extends ActiveQuery
{
public static function active($query)
public function active()
{
$query->andWhere('status=1');
$this->andWhere('status=1');
return $this;
}
}

View File

@ -7,9 +7,10 @@ use yii\mongodb\ActiveQuery;
*/
class CustomerQuery extends ActiveQuery
{
public static function activeOnly($query)
public function activeOnly()
{
$query->andWhere(['status' => 2]);
$this->andWhere(['status' => 2]);
return $this;
}
}

View File

@ -7,9 +7,10 @@ use yii\sphinx\ActiveQuery;
*/
class ArticleIndexQuery extends ActiveQuery
{
public static function favoriteAuthor($query)
public function favoriteAuthor()
{
$query->andWhere('author_id=1');
$this->andWhere('author_id=1');
return $this;
}
}