Files
SmartHomePHP/models/ItemQuery.php
Alex Solomaha c5ae61fddb Some work
2016-08-16 15:07:56 +03:00

50 lines
865 B
PHP

<?php
namespace app\models;
/**
* This is the ActiveQuery class for [[Item]].
*
* @see Item
*/
class ItemQuery extends \yii\db\ActiveQuery
{
public function variables()
{
return $this->andWhere([
'type' => [
Item::TYPE_VARIABLE,
Item::TYPE_VARIABLE_BOOLEAN,
Item::TYPE_VARIABLE_BOOLEAN_DOOR,
],
]);
}
public function switches()
{
return $this->andWhere([
'type' => [
Item::TYPE_SWITCH,
],
]);
}
/**
* @inheritdoc
* @return Item[]|array
*/
public function all($db = null)
{
return parent::all($db);
}
/**
* @inheritdoc
* @return Item|array|null
*/
public function one($db = null)
{
return parent::one($db);
}
}