Passed
Push — master ( afc50f...67ec34 )
by Mihail
04:58
created

FormContentPublish   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 23
rs 10
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A make() 0 4 1
1
<?php
2
3
namespace Apps\Model\Admin\Content;
4
5
use Ffcms\Core\Arch\Model;
6
7
class FormContentPublish extends Model
8
{
9
    /** @var \Apps\ActiveRecord\Content */
10
    private $_records;
11
12
    /**
13
     * FormContentPublish constructor. Pass records inside
14
     * @param $records
15
     */
16
    public function __construct($records)
17
    {
18
        $this->_records = $records;
19
        parent::__construct();
20
    }
21
22
    /**
23
     * Update records and set display = 1
24
     */
25
    public function make()
26
    {
27
        $this->_records->update(['display' => 1]);
28
    }
29
}