Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Source.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
12 use Magento\InventoryApi\Api\Data\SourceExtensionInterface;
14 
21 {
25  protected function _construct()
26  {
27  $this->_init(SourceResourceModel::class);
28  }
29 
33  public function getSourceCode(): ?string
34  {
35  return $this->getData(self::SOURCE_CODE);
36  }
37 
41  public function setSourceCode(?string $sourceCode): void
42  {
43  $this->setData(self::SOURCE_CODE, $sourceCode);
44  }
45 
49  public function getName(): ?string
50  {
51  return $this->getData(self::NAME);
52  }
53 
57  public function setName(?string $name): void
58  {
59  $this->setData(self::NAME, $name);
60  }
61 
65  public function getEmail(): ?string
66  {
67  return $this->getData(self::EMAIL);
68  }
69 
73  public function setEmail(?string $email): void
74  {
75  $this->setData(self::EMAIL, $email);
76  }
77 
81  public function getContactName(): ?string
82  {
83  return $this->getData(self::CONTACT_NAME);
84  }
85 
89  public function setContactName(?string $contactName): void
90  {
91  $this->setData(self::CONTACT_NAME, $contactName);
92  }
93 
97  public function isEnabled() :?bool
98  {
99  return $this->getData(self::ENABLED) === null ?
100  null:
101  (bool)$this->getData(self::ENABLED);
102  }
103 
107  public function setEnabled(?bool $enabled): void
108  {
109  $this->setData(self::ENABLED, $enabled);
110  }
111 
115  public function getDescription(): ?string
116  {
117  return $this->getData(self::DESCRIPTION);
118  }
119 
123  public function setDescription(?string $description): void
124  {
125  $this->setData(self::DESCRIPTION, $description);
126  }
127 
131  public function getLatitude(): ?float
132  {
133  return $this->getData(self::LATITUDE) === null ?
134  null:
135  (float)$this->getData(self::LATITUDE);
136  }
137 
141  public function setLatitude(?float $latitude): void
142  {
143  $this->setData(self::LATITUDE, $latitude);
144  }
145 
149  public function getLongitude(): ?float
150  {
151  return $this->getData(self::LONGITUDE) === null ?
152  null:
153  (float)$this->getData(self::LONGITUDE);
154  }
155 
159  public function setLongitude(?float $longitude): void
160  {
161  $this->setData(self::LONGITUDE, $longitude);
162  }
163 
167  public function getCountryId(): ?string
168  {
169  return $this->getData(self::COUNTRY_ID);
170  }
171 
175  public function setCountryId(?string $countryId): void
176  {
177  $this->setData(self::COUNTRY_ID, $countryId);
178  }
179 
183  public function getRegionId(): ?int
184  {
185  return $this->getData(self::REGION_ID) === null ?
186  null:
187  (int)$this->getData(self::REGION_ID);
188  }
189 
193  public function setRegionId(?int $regionId): void
194  {
195  $this->setData(self::REGION_ID, $regionId);
196  }
197 
201  public function getRegion(): ?string
202  {
203  return $this->getData(self::REGION);
204  }
205 
209  public function setRegion(?string $region): void
210  {
211  $this->setData(self::REGION, $region);
212  }
213 
217  public function getCity(): ?string
218  {
219  return $this->getData(self::CITY);
220  }
221 
225  public function setCity(?string $city): void
226  {
227  $this->setData(self::CITY, $city);
228  }
229 
233  public function getStreet(): ?string
234  {
235  return $this->getData(self::STREET);
236  }
237 
241  public function setStreet(?string $street): void
242  {
243  $this->setData(self::STREET, $street);
244  }
245 
249  public function getPostcode(): ?string
250  {
251  return $this->getData(self::POSTCODE);
252  }
253 
257  public function setPostcode(?string $postcode): void
258  {
259  $this->setData(self::POSTCODE, $postcode);
260  }
261 
265  public function getPhone(): ?string
266  {
267  return $this->getData(self::PHONE);
268  }
269 
273  public function setPhone(?string $phone): void
274  {
275  $this->setData(self::PHONE, $phone);
276  }
277 
281  public function getFax(): ?string
282  {
283  return $this->getData(self::FAX);
284  }
285 
289  public function setFax(?string $fax): void
290  {
291  $this->setData(self::FAX, $fax);
292  }
293 
297  public function isUseDefaultCarrierConfig(): ?bool
298  {
299  return true;
300  }
301 
305  public function setUseDefaultCarrierConfig(?bool $useDefaultCarrierConfig): void
306  {
307  $this->setData(self::USE_DEFAULT_CARRIER_CONFIG, $useDefaultCarrierConfig);
308  }
309 
313  public function getCarrierLinks(): ?array
314  {
315  return $this->getData(self::CARRIER_LINKS);
316  }
317 
321  public function setCarrierLinks(?array $carrierLinks): void
322  {
323  $this->setData(self::CARRIER_LINKS, $carrierLinks);
324  }
325 
329  public function getExtensionAttributes(): ?SourceExtensionInterface
330  {
332  if (null === $extensionAttributes) {
333  $extensionAttributes = $this->extensionAttributesFactory->create(SourceInterface::class);
335  }
336  return $extensionAttributes;
337  }
338 
342  public function setExtensionAttributes(SourceExtensionInterface $extensionAttributes): void
343  {
344  $this->_setExtensionAttributes($extensionAttributes);
345  }
346 }
setStreet(?string $street)
Definition: Source.php:241
setDescription(?string $description)
Definition: Source.php:123
setCountryId(?string $countryId)
Definition: Source.php:175
$email
Definition: details.phtml:13
setLongitude(?float $longitude)
Definition: Source.php:159
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
setLatitude(?float $latitude)
Definition: Source.php:141
setPostcode(?string $postcode)
Definition: Source.php:257
setRegionId(?int $regionId)
Definition: Source.php:193
setSourceCode(?string $sourceCode)
Definition: Source.php:41
setCarrierLinks(?array $carrierLinks)
Definition: Source.php:321
setName(?string $name)
Definition: Source.php:57
$sourceCode
Definition: inventory.phtml:11
setUseDefaultCarrierConfig(?bool $useDefaultCarrierConfig)
Definition: Source.php:305
setPhone(?string $phone)
Definition: Source.php:273
setExtensionAttributes(SourceExtensionInterface $extensionAttributes)
Definition: Source.php:342
setRegion(?string $region)
Definition: Source.php:209
setEnabled(?bool $enabled)
Definition: Source.php:107
setEmail(?string $email)
Definition: Source.php:73
setContactName(?string $contactName)
Definition: Source.php:89
if(!isset($_GET['name'])) $name
Definition: log.php:14