Completed
Push — master ( 33476c...427ebd )
by Bertrand
09:14
created

Page::pageId()   A

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 0
dl 0
loc 3
rs 10
1
<?php
2
3
4
namespace App\Src\UseCases\Domain\Agricultural\Model;
5
6
7
use App\Src\UseCases\Domain\Ports\PageRepository;
8
9
class Page
10
{
11
    private $pageId;
12
    private $dryState;
13
14
    public function __construct(int $pageId, bool $dryState = false)
15
    {
16
        $this->pageId = $pageId;
17
        $this->dryState = $dryState;
18
    }
19
20
    public function pageId():int
21
    {
22
        return $this->pageId;
23
    }
24
25
    public function setOnDryState()
26
    {
27
        $this->dryState = true;
28
        app(PageRepository::class)->save($this);
29
    }
30
31
    public function toArray()
32
    {
33
        return [
34
            'dry' => $this->dryState
35
        ];
36
    }
37
}
38