Passed
Pull Request — 1.x (#4)
by David
11:19
created

TdbmObjectType::hideAll()   A

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
7
use Youshido\GraphQL\Type\Object\AbstractObjectType;
8
9
abstract class TdbmObjectType extends AbstractObjectType
10
{
11
    /**
12
     * Returns the list of fields coming from TDBM beans.
13
     *
14
     * @return Field[]
15
     */
16
    protected function getFieldList(): array
17
    {
18
        return [];
19
    }
20
21
    protected function showAll(): void
22
    {
23
        foreach ($this->getFieldList() as $field) {
24
            $field->show();
25
        }
26
    }
27
28
    protected function hideAll(): void
29
    {
30
        foreach ($this->getFieldList() as $field) {
31
            $field->hide();
32
        }
33
    }
34
}
35