forked from thelia/thelia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModuleQuery.php
54 lines (47 loc) · 1.39 KB
/
ModuleQuery.php
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
<?php
namespace Thelia\Model;
use Thelia\Model\Base\ModuleQuery as BaseModuleQuery;
use Thelia\Module\BaseModule;
/**
* Skeleton subclass for performing query and update operations on the 'module' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
*/
class ModuleQuery extends BaseModuleQuery
{
protected static $activated = null;
/**
* @return array|mixed|\PropelObjectCollection
*/
public static function getActivated()
{
if (null === self::$activated) {
self::$activated = self::create()
->filterByActivate(BaseModule::IS_ACTIVATED)
->orderByPosition()
->find();
}
return self::$activated;
}
public static function resetActivated()
{
self::$activated = null;
}
/**
* @param int $moduleType the module type : classic, payment or delivery. Use BaseModule constant here.
* @param int $id the module id
* @return ModuleQuery
*/
public function filterActivatedByTypeAndId($moduleType, $id)
{
return $this
->filterByType($moduleType)
->filterByActivate(BaseModule::IS_ACTIVATED)
->filterById($id);
}
} // ModuleQuery