mirror of
https://github.com/CyanoFresh/SmartHomePHP.git
synced 2026-02-25 22:01:21 +01:00
20 lines
341 B
PHP
20 lines
341 B
PHP
<?php
|
|
|
|
namespace app\modules\server\models\query;
|
|
|
|
use yii\db\ActiveQuery;
|
|
|
|
abstract class BaseItemQuery extends ActiveQuery
|
|
{
|
|
public $type;
|
|
|
|
public function prepare($builder)
|
|
{
|
|
if ($this->type !== null) {
|
|
$this->andWhere(['type' => $this->type]);
|
|
}
|
|
|
|
return parent::prepare($builder);
|
|
}
|
|
}
|