GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( cf9260...b52382 )
by
unknown
03:19
created

AdjacencyTrait::getChilds()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 7
nc 3
nop 1
dl 0
loc 12
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the O2System Framework package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @author         Steeve Andrian Salim
9
 * @copyright      Copyright (c) Steeve Andrian Salim
10
 */
11
12
// ------------------------------------------------------------------------
13
14
namespace O2System\Framework\Models\Sql\Traits;
15
16
// ------------------------------------------------------------------------
17
18
/**
19
 * Class AdjacencyTrait
20
 *
21
 * @package O2System\Framework\Models\Sql\Traits
22
 */
23
trait AdjacencyTrait
24
{
25
    /**
26
     * AdjacencyTrait::$parentKey
27
     *
28
     * @var string
29
     */
30
    public $parentKey = 'id_parent';
31
32
    /**
33
     * AdjacencyTrait::$adjacency
34
     *
35
     * @var bool
36
     */
37
    protected $adjacency = true;
38
39
    // ------------------------------------------------------------------------
40
41
    /**
42
     * AdjacencyTrait::getChilds
43
     *
44
     * @param int $idParent
45
     *
46
     * @return bool|\O2System\Framework\Models\Sql\DataObjects\Result
47
     */
48
    public function getChilds($idParent)
49
    {
50
        if ($result = $this->qb
51
            ->from($this->table)
52
            ->where([$this->parentKey => $idParent])
53
            ->get()) {
54
            if ($result->count() > 0) {
55
                return $result;
56
            }
57
        }
58
59
        return false;
60
    }
61
62
    // ------------------------------------------------------------------------
63
64
    /**
65
     * AdjacencyTrait
66
     *
67
     * @param int $idParent
68
     *
69
     * @return bool
70
     */
71
    public function hasChilds($idParent)
72
    {
73
        if ($result = $this->qb
74
            ->select('id')
75
            ->from($this->table)
76
            ->where([$this->parentKey => $idParent])
77
            ->get()) {
78
            if ($result->count() > 0) {
79
                return true;
80
            }
81
        }
82
83
        return false;
84
    }
85
}