1 | <?php |
||
27 | class Attachment extends AbstractExtensibleModel implements AttachmentInterface, ComponentInterface, IdentityInterface |
||
28 | { |
||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | const CACHE_TAG = 'lizardmedia_productattachment_attachment'; |
||
33 | |||
34 | /** |
||
35 | * Tables |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | const MAIN_TABLE = 'lizardmedia_product_attachment'; |
||
40 | const TITLE_TABLE = 'lizardmedia_product_attachment_title'; |
||
41 | |||
42 | /** |
||
43 | * Main model field names |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | const ID = 'id'; |
||
48 | const PRODUCT_ID = 'product_id'; |
||
49 | const SORT_ORDER = 'sort_order'; |
||
50 | const ATTACHMENT_TYPE = 'attachment_type'; |
||
51 | const ATTACHMENT_FILE = 'attachment_file'; |
||
52 | const ATTACHMENT_FILE_CONTENT = 'attachment_file_content'; |
||
53 | const ATTACHMENT_URL = 'attachment_url'; |
||
54 | |||
55 | |||
56 | /** |
||
57 | * Title field names |
||
58 | * |
||
59 | * @var string |
||
60 | */ |
||
61 | const TITLE_ID = 'id'; |
||
62 | const ATTACHMENT_ID = 'attachment_id'; |
||
63 | const TITLE = 'title'; |
||
64 | const STORE_ID = 'store_id'; |
||
65 | |||
66 | /** |
||
67 | * @return void |
||
68 | */ |
||
69 | protected function _construct() |
||
74 | |||
75 | /** |
||
76 | * @return array |
||
77 | */ |
||
78 | public function getIdentities(): array |
||
82 | |||
83 | /** |
||
84 | * @return $this |
||
85 | */ |
||
86 | public function afterSave() |
||
91 | |||
92 | /** |
||
93 | * @return string |
||
94 | */ |
||
95 | public function getUrl() |
||
103 | |||
104 | /** |
||
105 | * @return string |
||
106 | */ |
||
107 | public function getBaseTmpPath(): string |
||
111 | |||
112 | /** |
||
113 | * @return string |
||
114 | */ |
||
115 | public function getBasePath(): string |
||
119 | |||
120 | /** |
||
121 | * @param int $productId |
||
122 | * @param int $storeId |
||
123 | * @return array |
||
124 | * @throws LocalizedException |
||
125 | */ |
||
126 | public function getSearchableData($productId, $storeId) |
||
130 | |||
131 | /** |
||
132 | * @return int |
||
133 | */ |
||
134 | public function getProductId() : int |
||
138 | |||
139 | /** |
||
140 | * @param int $id |
||
141 | * @return AttachmentInterface |
||
142 | */ |
||
143 | public function setProductId(int $id) : AttachmentInterface |
||
147 | |||
148 | /** |
||
149 | * @return string |
||
150 | */ |
||
151 | public function getTitle() : string |
||
155 | |||
156 | /** |
||
157 | * @param string $title |
||
158 | * @return AttachmentInterface |
||
159 | */ |
||
160 | public function setTitle(string $title) : AttachmentInterface |
||
164 | |||
165 | /** |
||
166 | * @return int |
||
167 | */ |
||
168 | public function getSortOrder() : int |
||
172 | |||
173 | /** |
||
174 | * @param int $sortOrder |
||
175 | * @return AttachmentInterface |
||
176 | */ |
||
177 | public function setSortOrder(int $sortOrder) : AttachmentInterface |
||
181 | |||
182 | /** |
||
183 | * @return string |
||
184 | */ |
||
185 | public function getAttachmentType() : string |
||
189 | |||
190 | /** |
||
191 | * @param string $attachmentType |
||
192 | * @return AttachmentInterface |
||
193 | */ |
||
194 | public function setAttachmentType(string $attachmentType) : AttachmentInterface |
||
198 | |||
199 | /** |
||
200 | * Relative file path |
||
201 | * @return string|null |
||
202 | */ |
||
203 | public function getAttachmentFile() : ?string |
||
207 | |||
208 | /** |
||
209 | * @param string $attachmentFile |
||
210 | * @return AttachmentInterface |
||
211 | */ |
||
212 | public function setAttachmentFile(string $attachmentFile) : AttachmentInterface |
||
216 | |||
217 | /** |
||
218 | * @return ContentInterface|null |
||
219 | */ |
||
220 | public function getAttachmentFileContent() : ?ContentInterface |
||
224 | |||
225 | /** |
||
226 | * @param ContentInterface $attachmentFileContent |
||
227 | * @return AttachmentInterface |
||
228 | */ |
||
229 | public function setAttachmentFileContent(ContentInterface $attachmentFileContent = null) : AttachmentInterface |
||
233 | |||
234 | /** |
||
235 | * @return string|null |
||
236 | */ |
||
237 | public function getAttachmentUrl() : ?string |
||
241 | |||
242 | /** |
||
243 | * @param string $attachmentUrl |
||
244 | * @return AttachmentInterface |
||
245 | */ |
||
246 | public function setAttachmentUrl(string $attachmentUrl) : AttachmentInterface |
||
250 | |||
251 | /** |
||
252 | * @return AttachmentExtensionInterface | null |
||
253 | */ |
||
254 | public function getExtensionAttributes() : ?AttachmentExtensionInterface |
||
258 | |||
259 | /** |
||
260 | * @param AttachmentExtensionInterface $extensionAttributes |
||
261 | * @return AttachmentInterface |
||
262 | */ |
||
263 | public function setExtensionAttributes(AttachmentExtensionInterface $extensionAttributes) : AttachmentInterface |
||
267 | } |
||
268 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: