Row::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace kalanis\kw_connect\nette;
4
5
6
use kalanis\kw_connect\core\Interfaces\IRow;
7
use Nette\Database\IRow as NetteRow;
8
9
10
/**
11
 * Class Row
12
 * @package kalanis\kw_connect\nette
13
 */
14
class Row implements IRow
15
{
16
    /** @var NetteRow<string|int, string|int|float|bool|null> */
17
    protected NetteRow $row;
18
19
    /**
20
     * @param NetteRow<string|int, string|int|float|bool|null> $row
21
     */
22
    public function __construct(NetteRow $row)
23
    {
24
        $this->row = $row;
25
    }
26
27
    public function getValue($property)
28
    {
29
        return $this->row->offsetGet($property);
30
    }
31
32
    public function __isset($name)
33
    {
34
        return $this->row->offsetExists($name);
35
    }
36
}
37