HasMany::populateQuerySpecific()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
3
namespace Nip\Records\Relations;
4
5
use Nip\Database\Query\AbstractQuery;
6
use Nip\Database\Query\Select as Query;
7
8
/**
9
 * Class HasMany
10
 * @package Nip\Records\Relations
11
 */
12
class HasMany extends HasOneOrMany
13
{
14
15
    /**
16
     * @inheritdoc
17
     */
18
    public function populateQuerySpecific(AbstractQuery $query)
19
    {
20
        $primaryKey = $this->getManager()->getPrimaryKey();
21
        $query->where('`' . $this->getFK() . '` = ?', $this->getItem()->{$primaryKey});
22
23
        return $query;
24
    }
25
}
26