Total Complexity | 4 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | class Fields extends Component |
||
27 | { |
||
28 | |||
29 | // Private Properties |
||
30 | // ========================================================================= |
||
31 | |||
32 | private $_matrixFieldIds; |
||
33 | |||
34 | // Public Methods |
||
35 | // ========================================================================= |
||
36 | |||
37 | /** |
||
38 | * Returns an array of all the Matrix field ids |
||
39 | * @return array |
||
40 | */ |
||
41 | public function getMatrixFieldIds() |
||
42 | { |
||
43 | |||
44 | if (!$this->_matrixFieldIds) |
||
45 | { |
||
46 | $this->_matrixFieldIds = (new Query()) |
||
47 | ->select(['id']) |
||
48 | ->from('{{%fields}}') |
||
49 | ->where('type = :type', [':type' => 'craft\fields\Matrix']) |
||
50 | ->column(); |
||
51 | } |
||
52 | |||
53 | return $this->_matrixFieldIds; |
||
54 | |||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Returns an array of Matrix fields |
||
59 | * @return array |
||
60 | */ |
||
61 | public function getMatrixFields() |
||
72 | |||
73 | } |
||
76 |