These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | namespace Redaxscript\Model; |
||
3 | |||
4 | /** |
||
5 | * parent class to provide the module model |
||
6 | * |
||
7 | * @since 3.3.0 |
||
8 | * |
||
9 | * @package Redaxscript |
||
10 | * @category Model |
||
11 | * @author Henry Ruhs |
||
12 | */ |
||
13 | |||
14 | class Module extends ModelAbstract |
||
15 | { |
||
16 | /** |
||
17 | * name of the table |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | |||
22 | protected $_table = 'modules'; |
||
23 | |||
24 | /** |
||
25 | * create the module by array |
||
26 | * |
||
27 | * @since 3.3.0 |
||
28 | * |
||
29 | * @param array $createArray array of the create |
||
30 | * |
||
31 | * @return bool |
||
32 | */ |
||
33 | |||
34 | public function createByArray(array $createArray = []) : bool |
||
35 | { |
||
36 | return $this |
||
37 | ->query() |
||
38 | ->create() |
||
39 | ->set($createArray) |
||
40 | ->save(); |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * delete the module by alias |
||
45 | * |
||
46 | * @since 3.3.0 |
||
47 | * |
||
48 | * @param string $moduleAlias alias of the module |
||
49 | * |
||
50 | * @return bool |
||
51 | */ |
||
52 | |||
53 | public function deleteByAlias(string $moduleAlias = null) : bool |
||
54 | { |
||
55 | return $this->query()->where('alias', $moduleAlias)->deleteMany(); |
||
0 ignored issues
–
show
|
|||
56 | } |
||
57 | } |
||
58 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: