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.

HasOneThrough   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 16
c 2
b 0
f 0
dl 0
loc 32
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A getResult() 0 25 3
1
<?php
2
/**
3
 * This file is part of the O2System Reactor 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\Reactor\Models\Sql\Relations;
15
16
// ------------------------------------------------------------------------
17
18
use O2System\Reactor\Models\Sql;
19
20
/**
21
 * Class HasOneThrough
22
 *
23
 * @package O2System\Reactor\Models\Sql\Relations
24
 */
25
class HasOneThrough extends Sql\Relations\Abstracts\AbstractRelation
26
{
27
    /**
28
     * HasOneThrough::getResult
29
     * 
30
     * @return array|bool|\O2System\Reactor\Models\Sql\DataObjects\Result\Row
31
     */
32
    public function getResult()
33
    {
34
        if ($this->map->currentModel->row instanceof Sql\DataObjects\Result\Row) {
0 ignored issues
show
Bug introduced by
The property currentModel does not seem to exist on O2System\Reactor\Models\...elations\Maps\Reference.
Loading history...
Bug introduced by
The property currentModel does not seem to exist on O2System\Reactor\Models\...tions\Maps\Intermediary.
Loading history...
Bug introduced by
The property currentModel does not seem to exist on O2System\Reactor\Models\Sql\Relations\Maps\Inverse.
Loading history...
Bug introduced by
The property currentModel does not seem to exist on O2System\Reactor\Models\Sql\Relations\Maps\Through.
Loading history...
35
            $criteria = $this->map->currentModel->row->offsetGet($this->map->currentPrimaryKey);
0 ignored issues
show
Bug introduced by
The property currentPrimaryKey does not seem to exist on O2System\Reactor\Models\...tions\Maps\Intermediary.
Loading history...
Bug introduced by
The property currentPrimaryKey does not seem to exist on O2System\Reactor\Models\Sql\Relations\Maps\Through.
Loading history...
Bug introduced by
The property currentPrimaryKey does not seem to exist on O2System\Reactor\Models\...elations\Maps\Reference.
Loading history...
Bug introduced by
The property currentPrimaryKey does not seem to exist on O2System\Reactor\Models\Sql\Relations\Maps\Inverse.
Loading history...
36
            $field = $this->map->intermediaryTable . '.' . $this->map->intermediaryPrimaryKey;
0 ignored issues
show
Bug introduced by
The property intermediaryTable does not seem to exist on O2System\Reactor\Models\...tions\Maps\Intermediary.
Loading history...
Bug introduced by
The property intermediaryPrimaryKey does not seem to exist on O2System\Reactor\Models\Sql\Relations\Maps\Through.
Loading history...
Bug introduced by
The property intermediaryPrimaryKey does not seem to exist on O2System\Reactor\Models\Sql\Relations\Maps\Inverse.
Loading history...
Bug introduced by
The property intermediaryTable does not seem to exist on O2System\Reactor\Models\Sql\Relations\Maps\Through.
Loading history...
Bug introduced by
The property intermediaryTable does not seem to exist on O2System\Reactor\Models\...elations\Maps\Reference.
Loading history...
Bug introduced by
The property intermediaryPrimaryKey does not seem to exist on O2System\Reactor\Models\...tions\Maps\Intermediary.
Loading history...
Bug introduced by
The property intermediaryTable does not seem to exist on O2System\Reactor\Models\Sql\Relations\Maps\Inverse.
Loading history...
Bug introduced by
The property intermediaryPrimaryKey does not seem to exist on O2System\Reactor\Models\...elations\Maps\Reference.
Loading history...
37
38
            $this->map->referenceModel->qb
0 ignored issues
show
Bug introduced by
The property referenceModel does not exist on O2System\Reactor\Models\...tions\Maps\Intermediary. Did you mean referenceTable?
Loading history...
39
                ->select([
40
                    $this->map->referenceTable . '.*',
41
                ])
42
                ->join($this->map->currentTable, implode(' = ', [
0 ignored issues
show
Bug introduced by
The property currentTable does not seem to exist on O2System\Reactor\Models\Sql\Relations\Maps\Inverse.
Loading history...
Bug introduced by
The property currentTable does not seem to exist on O2System\Reactor\Models\...tions\Maps\Intermediary.
Loading history...
Bug introduced by
The property currentTable does not seem to exist on O2System\Reactor\Models\...elations\Maps\Reference.
Loading history...
Bug introduced by
The property currentTable does not seem to exist on O2System\Reactor\Models\Sql\Relations\Maps\Through.
Loading history...
43
                    $this->map->currentTable . '.' . $this->map->intermediaryCurrentForeignKey,
0 ignored issues
show
Bug introduced by
The property intermediaryCurrentForeignKey does not seem to exist on O2System\Reactor\Models\Sql\Relations\Maps\Through.
Loading history...
Bug introduced by
The property intermediaryCurrentForeignKey does not seem to exist on O2System\Reactor\Models\...elations\Maps\Reference.
Loading history...
Bug introduced by
The property intermediaryCurrentForeignKey does not seem to exist on O2System\Reactor\Models\Sql\Relations\Maps\Inverse.
Loading history...
Bug introduced by
The property intermediaryCurrentForeignKey does not seem to exist on O2System\Reactor\Models\...tions\Maps\Intermediary.
Loading history...
44
                    $this->map->intermediaryTable . '.' . $this->map->intermediaryPrimaryKey,
45
                ]))
46
                ->join($this->map->referenceTable, implode(' = ', [
47
                    $this->map->referenceTable . '.' . $this->map->referencePrimaryKey,
48
                    $this->map->intermediaryTable . '.' . $this->map->intermediaryReferenceForeignKey,
0 ignored issues
show
Bug introduced by
The property intermediaryReferenceForeignKey does not seem to exist on O2System\Reactor\Models\Sql\Relations\Maps\Through.
Loading history...
Bug introduced by
The property intermediaryReferenceForeignKey does not seem to exist on O2System\Reactor\Models\...elations\Maps\Reference.
Loading history...
Bug introduced by
The property intermediaryReferenceForeignKey does not seem to exist on O2System\Reactor\Models\Sql\Relations\Maps\Inverse.
Loading history...
Bug introduced by
The property intermediaryReferenceForeignKey does not seem to exist on O2System\Reactor\Models\...tions\Maps\Intermediary.
Loading history...
49
                ]));
50
51
            if ($result = $this->map->intermediaryModel->find($criteria, $field, 1)) {
0 ignored issues
show
Bug introduced by
The property intermediaryModel does not seem to exist on O2System\Reactor\Models\Sql\Relations\Maps\Inverse.
Loading history...
Bug introduced by
The property intermediaryModel does not seem to exist on O2System\Reactor\Models\...elations\Maps\Reference.
Loading history...
Bug introduced by
The property intermediaryModel does not seem to exist on O2System\Reactor\Models\Sql\Relations\Maps\Through.
Loading history...
Bug introduced by
The property intermediaryModel does not seem to exist on O2System\Reactor\Models\...tions\Maps\Intermediary.
Loading history...
52
                return $result;
53
            }
54
        }
55
56
        return false;
57
    }
58
}