mirror of
https://github.com/CyanoFresh/SmartHomePHP.git
synced 2026-03-11 12:26:52 +01:00
smarthome-49 Divide Item Widgets from Item
This commit is contained in:
63
models/ItemWidgetQuery.php
Normal file
63
models/ItemWidgetQuery.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace app\models;
|
||||
|
||||
use yii\db\ActiveQuery;
|
||||
|
||||
/**
|
||||
* This is the ActiveQuery class for [[ItemWidget]].
|
||||
*
|
||||
* @see ItemWidget
|
||||
*/
|
||||
class ItemWidgetQuery extends ActiveQuery
|
||||
{
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function active()
|
||||
{
|
||||
return $this->andWhere(['active' => true]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function switches()
|
||||
{
|
||||
return $this->andWhere(['type' => ItemWidget::TYPE_SWITCH]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function variables()
|
||||
{
|
||||
return $this->andWhere(['type' => ItemWidget::TYPE_VARIABLE]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function rgb()
|
||||
{
|
||||
return $this->andWhere(['type' => ItemWidget::TYPE_RGB]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
* @return ItemWidget[]|array
|
||||
*/
|
||||
public function all($db = null)
|
||||
{
|
||||
return parent::all($db);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
* @return ItemWidget|array|null
|
||||
*/
|
||||
public function one($db = null)
|
||||
{
|
||||
return parent::one($db);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user