Completed
Push — master ( 0628b8...eeb119 )
by Cheren
02:37
created

Entity::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
/**
3
 * CakeCMS Core
4
 *
5
 * This file is part of the of the simple cms based on CakePHP 3.
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * @package   Core
10
 * @license   MIT
11
 * @copyright MIT License http://www.opensource.org/licenses/mit-license.php
12
 * @link      https://github.com/CakeCMS/Core".
13
 * @author    Sergey Kalistratov <[email protected]>
14
 */
15
16
namespace Core\ORM\Entity;
17
18
use Core\Cms;
19
use JBZoo\Data\Data;
20
use JBZoo\Data\JSON;
21
use Cake\ORM\Entity as CakeEntity;
22
23
/**
24
 * Class Entity
25
 *
26
 * @package Core\ORM\Entity
27
 * @property Data $params
28
 */
29
class Entity extends CakeEntity
30
{
31
32
    /**
33
     * Hold CMS object.
34
     *
35
     * @var Cms
36
     */
37
    public $cms;
38
39
    /**
40
     * Entity constructor.
41
     *
42
     * @param array $properties
43
     * @param array $options
44
     */
45
    public function __construct(array $properties = [], array $options = [])
46
    {
47
        parent::__construct($properties, $options);
48
        $this->cms = Cms::getInstance();
49
    }
50
51
    /**
52
     * Create new current params field.
53
     *
54
     * @param $params
55
     * @return JSON
56
     */
57
    protected function _getParams($params)
58
    {
59
        return new JSON($params);
60
    }
61
}
62