Row   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 29
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 3
1
<?php
2
/**
3
 * Created by Vitaly Iegorov <[email protected]>.
4
 * on 10.02.16 at 21:20
5
 */
6
namespace samsoncms\api\field;
7
8
/**
9
 * Additional fields table row.
10
 * This class is needed for generation of specific table row classes
11
 * with defined fields.
12
 *
13
 * @package samsoncms\api\field
14
 * @deprecated Use generated \samsoncms\api\generated\*TableEntity
15
 */
16
class Row
17
{
18
    /** @var array Collection of additional fields identifiers */
19
    protected static $fieldIDs = array();
20
    /** @var int Material primary identifier */
21
    public $primary;
22
    /** @var array Field table row fields collection */
23
    protected $collection;
24
25
    /**
26
     * Row constructor.
27
     *
28
     * @param int   $primary Material entity identifier
29
     * @param array $collection Collection of row additional field values
30
     */
31
    public function __construct($primary, array $collection)
32
    {
33
        $this->primary = $primary;
34
        $this->collection = $collection;
35
36
        // Set row fields
37
        foreach ($collection as $key => $value) {
38
            if ($key === 'primary') {
39
                continue;
40
            }
41
            $this->$key = $value;
42
        }
43
    }
44
}
45