ActiveQuery.php
1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
namespace thread\modules\seo\models\query;
use thread\app\base\models\ActiveRecord;
/**
* Class ActiveQuery
*
* @package thread\modules\seo\models\query
* @author FilamentV <vortex.filament@gmail.com>
* @copyright (c), Thread
*/
class ActiveQuery extends \thread\app\base\models\query\ActiveQuery
{
/**
* @param int $model_id
* @return $this
*/
public function model_id(int $model_id)
{
$modelClass = $this->modelClass;
$this->andWhere($modelClass::tableName() . '.model_id = :model_id', [':model_id' => $model_id]);
return $this;
}
/**
* @param string $model_key
* @return $this
*/
public function model_key(string $model_key)
{
$modelClass = $this->modelClass;
$this->andWhere($modelClass::tableName() . '.model_key = :model_key', [':model_key' => $model_key]);
return $this;
}
/**
* @return $this
*/
public function add_to_sitemap()
{
$modelClass = $this->modelClass;
$this->andWhere($modelClass::tableName() . '.add_to_sitemap = :add_to_sitemap', [':add_to_sitemap' => ActiveRecord::STATUS_KEY_ON]);
return $this;
}
/**
* @return $this
*/
public function dissallow_in_robotstxt()
{
$modelClass = $this->modelClass;
$this->andWhere($modelClass::tableName() . '.dissallow_in_robotstxt = :dissallow_in_robotstxt', [':dissallow_in_robotstxt' => ActiveRecord::STATUS_KEY_ON]);
return $this;
}
}