1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* File: Catalogue.php |
4
|
|
|
* |
5
|
|
|
* @author Maciej Sławik <[email protected]> |
6
|
|
|
* Github: https://github.com/maciejslawik |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace MSlwk\ICatalogue\Model; |
10
|
|
|
|
11
|
|
|
use Magento\Framework\Model\AbstractExtensibleModel; |
12
|
|
|
use MSlwk\ICatalogue\Api\CatalogueInterface; |
13
|
|
|
use MSlwk\ICatalogue\Model\ResourceModel\Catalogue as CatalogueResource; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Class Catalogue |
17
|
|
|
* |
18
|
|
|
* @package MSlwk\ICatalogue\Model |
19
|
|
|
*/ |
20
|
|
|
class Catalogue extends AbstractExtensibleModel implements CatalogueInterface |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* @inheritdoc |
24
|
|
|
*/ |
25
|
|
|
protected function _construct() |
26
|
|
|
{ |
27
|
|
|
$this->_init(CatalogueResource::class); |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @return int|null |
32
|
|
|
*/ |
33
|
|
|
public function getId() |
34
|
|
|
{ |
35
|
|
|
return $this->getData(self::CATALOGUE_ID); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @return string |
40
|
|
|
*/ |
41
|
|
|
public function getTitle() : string |
42
|
|
|
{ |
43
|
|
|
return $this->getData(self::TITLE); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @return string |
48
|
|
|
*/ |
49
|
|
|
public function getCreatedAt() : string |
50
|
|
|
{ |
51
|
|
|
return $this->getData(self::CREATED_AT); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @return string |
56
|
|
|
*/ |
57
|
|
|
public function getUpdatedAt() : string |
58
|
|
|
{ |
59
|
|
|
return $this->getData(self::UPDATED_AT); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @param int $id |
64
|
|
|
* @return CatalogueInterface |
65
|
|
|
*/ |
66
|
|
|
public function setId($id) |
67
|
|
|
{ |
68
|
|
|
return $this->setData(self::CATALOGUE_ID, $id); |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @param string $title |
73
|
|
|
* @return CatalogueInterface |
74
|
|
|
*/ |
75
|
|
|
public function setTitle(string $title) : CatalogueInterface |
76
|
|
|
{ |
77
|
|
|
return $this->setData(self::TITLE, $title); |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @param string $createdAt |
82
|
|
|
* @return CatalogueInterface |
83
|
|
|
*/ |
84
|
|
|
public function setCreatedAt(string $createdAt) : CatalogueInterface |
85
|
|
|
{ |
86
|
|
|
return $this->setData(self::CREATED_AT, $createdAt); |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @param string $updatedAt |
91
|
|
|
* @return CatalogueInterface |
92
|
|
|
*/ |
93
|
|
|
public function setUpdatedAt(string $updatedAt) : CatalogueInterface |
94
|
|
|
{ |
95
|
|
|
return $this->setData(self::UPDATED_AT, $updatedAt); |
96
|
|
|
} |
97
|
|
|
} |
98
|
|
|
|