TdbmObjectType::hideAll()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 0
1
<?php
2
3
4
namespace TheCodingMachine\Tdbm\GraphQL;
5
6
use Youshido\GraphQL\Type\Object\AbstractObjectType;
7
8
abstract class TdbmObjectType extends AbstractObjectType
9
{
10
    /**
11
     * Returns the list of fields coming from TDBM beans.
12
     *
13
     * @return Field[]
14
     */
15
    protected function getFieldList(): array
16
    {
17
        return [];
18
    }
19
20
    protected function showAll(): void
21
    {
22
        foreach ($this->getFieldList() as $field) {
23
            $field->show();
24
        }
25
    }
26
27
    protected function hideAll(): void
28
    {
29
        foreach ($this->getFieldList() as $field) {
30
            $field->hide();
31
        }
32
    }
33
}
34