FormContentPublish   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

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