Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions
Source Class Reference
Inheritance diagram for Source:
AbstractExtensibleModel SourceInterface AbstractModel CustomAttributesDataInterface ExtensibleDataInterface DataObject ExtensibleDataInterface

Public Member Functions

 getSourceCode ()
 
 setSourceCode (?string $sourceCode)
 
 getName ()
 
 setName (?string $name)
 
 getEmail ()
 
 setEmail (?string $email)
 
 getContactName ()
 
 setContactName (?string $contactName)
 
 isEnabled ()
 
 setEnabled (?bool $enabled)
 
 getDescription ()
 
 setDescription (?string $description)
 
 getLatitude ()
 
 setLatitude (?float $latitude)
 
 getLongitude ()
 
 setLongitude (?float $longitude)
 
 getCountryId ()
 
 setCountryId (?string $countryId)
 
 getRegionId ()
 
 setRegionId (?int $regionId)
 
 getRegion ()
 
 setRegion (?string $region)
 
 getCity ()
 
 setCity (?string $city)
 
 getStreet ()
 
 setStreet (?string $street)
 
 getPostcode ()
 
 setPostcode (?string $postcode)
 
 getPhone ()
 
 setPhone (?string $phone)
 
 getFax ()
 
 setFax (?string $fax)
 
 isUseDefaultCarrierConfig ()
 
 setUseDefaultCarrierConfig (?bool $useDefaultCarrierConfig)
 
 getCarrierLinks ()
 
 setCarrierLinks (?array $carrierLinks)
 
 getExtensionAttributes ()
 
 setExtensionAttributes (SourceExtensionInterface $extensionAttributes)
 
- Public Member Functions inherited from AbstractExtensibleModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $customAttributeFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 getCustomAttributes ()
 
 getCustomAttribute ($attributeCode)
 
 setCustomAttributes (array $attributes)
 
 setCustomAttribute ($attributeCode, $attributeValue)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 setId ($value)
 
 __sleep ()
 
 __wakeup ()
 
- Public Member Functions inherited from AbstractModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 __sleep ()
 
 __wakeup ()
 
 setIdFieldName ($name)
 
 getIdFieldName ()
 
 getId ()
 
 setId ($value)
 
 isDeleted ($isDeleted=null)
 
 hasDataChanges ()
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 setDataChanges ($value)
 
 getOrigData ($key=null)
 
 setOrigData ($key=null, $data=null)
 
 dataHasChangedFor ($field)
 
 getResourceName ()
 
 getResourceCollection ()
 
 getCollection ()
 
 load ($modelId, $field=null)
 
 beforeLoad ($identifier, $field=null)
 
 afterLoad ()
 
 isSaveAllowed ()
 
 setHasDataChanges ($flag)
 
 save ()
 
 afterCommitCallback ()
 
 isObjectNew ($flag=null)
 
 beforeSave ()
 
 validateBeforeSave ()
 
 getCacheTags ()
 
 cleanModelCache ()
 
 afterSave ()
 
 delete ()
 
 beforeDelete ()
 
 afterDelete ()
 
 afterDeleteCommit ()
 
 getResource ()
 
 getEntityId ()
 
 setEntityId ($entityId)
 
 clearInstance ()
 
 getStoredData ()
 
 getEventPrefix ()
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 
- Public Member Functions inherited from SourceInterface
 setExtensionAttributes (\Magento\InventoryApi\Api\Data\SourceExtensionInterface $extensionAttributes)
 

Protected Member Functions

 _construct ()
 
- Protected Member Functions inherited from AbstractExtensibleModel
 filterCustomAttributes ($data)
 
 initializeCustomAttributes ()
 
 convertCustomAttributeValues (array &$customAttributes)
 
 getCustomAttributesCodes ()
 
 _setExtensionAttributes (\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
 
 _getExtensionAttributes ()
 
- Protected Member Functions inherited from AbstractModel
 _construct ()
 
 _init ($resourceModel)
 
 _setResourceModel ($resourceName, $collectionName=null)
 
 _getResource ()
 
 _getEventData ()
 
 _beforeLoad ($modelId, $field=null)
 
 _afterLoad ()
 
 _hasModelChanged ()
 
 _getValidatorBeforeSave ()
 
 _createValidatorBeforeSave ()
 
 _getValidationRulesBeforeSave ()
 
 _clearReferences ()
 
 _clearData ()
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 

Additional Inherited Members

- Data Fields inherited from CustomAttributesDataInterface
const CUSTOM_ATTRIBUTES = 'custom_attributes'
 
- Data Fields inherited from ExtensibleDataInterface
const EXTENSION_ATTRIBUTES_KEY = 'extension_attributes'
 
- Data Fields inherited from SourceInterface
const SOURCE_CODE = 'source_code'
 
const NAME = 'name'
 
const CONTACT_NAME = 'contact_name'
 
const EMAIL = 'email'
 
const ENABLED = 'enabled'
 
const DESCRIPTION = 'description'
 
const LATITUDE = 'latitude'
 
const LONGITUDE = 'longitude'
 
const COUNTRY_ID = 'country_id'
 
const REGION_ID = 'region_id'
 
const REGION = 'region'
 
const CITY = 'city'
 
const STREET = 'street'
 
const POSTCODE = 'postcode'
 
const PHONE = 'phone'
 
const FAX = 'fax'
 
const USE_DEFAULT_CARRIER_CONFIG = 'use_default_carrier_config'
 
const CARRIER_LINKS = 'carrier_links'
 
- Protected Attributes inherited from AbstractExtensibleModel
 $extensionAttributesFactory
 
 $extensionAttributes
 
 $customAttributeFactory
 
 $customAttributesCodes = null
 
 $customAttributesChanged = false
 
- Protected Attributes inherited from AbstractModel
 $_eventPrefix = 'core_abstract'
 
 $_eventObject = 'object'
 
 $_idFieldName = 'id'
 
 $_hasDataChanges = false
 
 $_origData
 
 $_isDeleted = false
 
 $_resource
 
 $_resourceCollection
 
 $_resourceName
 
 $_collectionName
 
 $_cacheTag = false
 
 $_dataSaveAllowed = true
 
 $_isObjectNew = null
 
 $_validatorBeforeSave = null
 
 $_eventManager
 
 $_cacheManager
 
 $_registry
 
 $_logger
 
 $_appState
 
 $_actionValidator
 
 $storedData = []
 
- Protected Attributes inherited from DataObject
 $_data = []
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

{}

@codeCoverageIgnore

Definition at line 20 of file Source.php.

Member Function Documentation

◆ _construct()

_construct ( )
protected

Definition at line 25 of file Source.php.

26  {
27  $this->_init(SourceResourceModel::class);
28  }

◆ getCarrierLinks()

getCarrierLinks ( )

Returns
\Magento\InventoryApi\Api\Data\SourceCarrierLinkInterface[]|null

Implements SourceInterface.

Definition at line 313 of file Source.php.

313  : ?array
314  {
315  return $this->getData(self::CARRIER_LINKS);
316  }

◆ getCity()

getCity ( )

Get source city

Returns
string|null

Implements SourceInterface.

Definition at line 217 of file Source.php.

217  : ?string
218  {
219  return $this->getData(self::CITY);
220  }

◆ getContactName()

getContactName ( )

Get source contact name

Returns
string|null

Implements SourceInterface.

Definition at line 81 of file Source.php.

81  : ?string
82  {
83  return $this->getData(self::CONTACT_NAME);
84  }

◆ getCountryId()

getCountryId ( )

Get source country id

Returns
string|null

Implements SourceInterface.

Definition at line 167 of file Source.php.

167  : ?string
168  {
169  return $this->getData(self::COUNTRY_ID);
170  }

◆ getDescription()

getDescription ( )

Get source description

Returns
string|null

Implements SourceInterface.

Definition at line 115 of file Source.php.

115  : ?string
116  {
117  return $this->getData(self::DESCRIPTION);
118  }

◆ getEmail()

getEmail ( )

Get source email

Returns
string|null

Implements SourceInterface.

Definition at line 65 of file Source.php.

65  : ?string
66  {
67  return $this->getData(self::EMAIL);
68  }

◆ getExtensionAttributes()

getExtensionAttributes ( )

Retrieve existing extension attributes object

Returns
\Magento\InventoryApi\Api\Data\SourceExtensionInterface|null

Implements SourceInterface.

Definition at line 329 of file Source.php.

329  : ?SourceExtensionInterface
330  {
332  if (null === $extensionAttributes) {
333  $extensionAttributes = $this->extensionAttributesFactory->create(SourceInterface::class);
335  }
336  return $extensionAttributes;
337  }
setExtensionAttributes(SourceExtensionInterface $extensionAttributes)
Definition: Source.php:342

◆ getFax()

getFax ( )

Get source fax

Returns
string|null

Implements SourceInterface.

Definition at line 281 of file Source.php.

281  : ?string
282  {
283  return $this->getData(self::FAX);
284  }

◆ getLatitude()

getLatitude ( )

Get source latitude

Returns
float|null

Implements SourceInterface.

Definition at line 131 of file Source.php.

131  : ?float
132  {
133  return $this->getData(self::LATITUDE) === null ?
134  null:
135  (float)$this->getData(self::LATITUDE);
136  }

◆ getLongitude()

getLongitude ( )

Get source longitude

Returns
float|null

Implements SourceInterface.

Definition at line 149 of file Source.php.

149  : ?float
150  {
151  return $this->getData(self::LONGITUDE) === null ?
152  null:
153  (float)$this->getData(self::LONGITUDE);
154  }

◆ getName()

getName ( )

Get source name

Returns
string|null

Implements SourceInterface.

Definition at line 49 of file Source.php.

49  : ?string
50  {
51  return $this->getData(self::NAME);
52  }

◆ getPhone()

getPhone ( )

Get source phone number

Returns
string|null

Implements SourceInterface.

Definition at line 265 of file Source.php.

265  : ?string
266  {
267  return $this->getData(self::PHONE);
268  }

◆ getPostcode()

getPostcode ( )

Get source post code

Returns
string|null

Implements SourceInterface.

Definition at line 249 of file Source.php.

249  : ?string
250  {
251  return $this->getData(self::POSTCODE);
252  }

◆ getRegion()

getRegion ( )

Get region title if source has custom region

Returns
string|null

Implements SourceInterface.

Definition at line 201 of file Source.php.

201  : ?string
202  {
203  return $this->getData(self::REGION);
204  }

◆ getRegionId()

getRegionId ( )

Get region id if source has registered region.

Returns
int|null

Implements SourceInterface.

Definition at line 183 of file Source.php.

183  : ?int
184  {
185  return $this->getData(self::REGION_ID) === null ?
186  null:
187  (int)$this->getData(self::REGION_ID);
188  }

◆ getSourceCode()

getSourceCode ( )

Get source code

Returns
string|null

Implements SourceInterface.

Definition at line 33 of file Source.php.

33  : ?string
34  {
35  return $this->getData(self::SOURCE_CODE);
36  }

◆ getStreet()

getStreet ( )

Get source street name

Returns
string|null

Implements SourceInterface.

Definition at line 233 of file Source.php.

233  : ?string
234  {
235  return $this->getData(self::STREET);
236  }

◆ isEnabled()

isEnabled ( )

Check if source is enabled. For new entity can be null

Returns
bool|null

Implements SourceInterface.

Definition at line 97 of file Source.php.

97  :?bool
98  {
99  return $this->getData(self::ENABLED) === null ?
100  null:
101  (bool)$this->getData(self::ENABLED);
102  }

◆ isUseDefaultCarrierConfig()

isUseDefaultCarrierConfig ( )

Check is need to use default config

Returns
bool|null

Implements SourceInterface.

Definition at line 297 of file Source.php.

297  : ?bool
298  {
299  return true;
300  }

◆ setCarrierLinks()

setCarrierLinks ( ?array  $carrierLinks)

Parameters

Implements SourceInterface.

Definition at line 321 of file Source.php.

321  : void
322  {
323  $this->setData(self::CARRIER_LINKS, $carrierLinks);
324  }

◆ setCity()

setCity ( ?string  $city)

Set source city

Parameters
string | null$city
Returns
void

Implements SourceInterface.

Definition at line 225 of file Source.php.

225  : void
226  {
227  $this->setData(self::CITY, $city);
228  }

◆ setContactName()

setContactName ( ?string  $contactName)

Set source contact name

Parameters
string | null$contactName
Returns
void

Implements SourceInterface.

Definition at line 89 of file Source.php.

89  : void
90  {
91  $this->setData(self::CONTACT_NAME, $contactName);
92  }

◆ setCountryId()

setCountryId ( ?string  $countryId)

Set source country id

Parameters
string | null$countryId
Returns
void

Implements SourceInterface.

Definition at line 175 of file Source.php.

175  : void
176  {
177  $this->setData(self::COUNTRY_ID, $countryId);
178  }

◆ setDescription()

setDescription ( ?string  $description)

Set source description

Parameters
string | null$description
Returns
void

Implements SourceInterface.

Definition at line 123 of file Source.php.

123  : void
124  {
125  $this->setData(self::DESCRIPTION, $description);
126  }

◆ setEmail()

setEmail ( ?string  $email)

Set source email

Parameters
string | null$email
Returns
void

Implements SourceInterface.

Definition at line 73 of file Source.php.

73  : void
74  {
75  $this->setData(self::EMAIL, $email);
76  }
$email
Definition: details.phtml:13

◆ setEnabled()

setEnabled ( ?bool  $enabled)

Enable or disable source

Parameters
bool | null$enabled
Returns
void

Implements SourceInterface.

Definition at line 107 of file Source.php.

107  : void
108  {
109  $this->setData(self::ENABLED, $enabled);
110  }

◆ setExtensionAttributes()

setExtensionAttributes ( SourceExtensionInterface  $extensionAttributes)

Definition at line 342 of file Source.php.

342  : void
343  {
345  }
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)

◆ setFax()

setFax ( ?string  $fax)

Set source fax

Parameters
string | null$fax
Returns
void

Implements SourceInterface.

Definition at line 289 of file Source.php.

289  : void
290  {
291  $this->setData(self::FAX, $fax);
292  }

◆ setLatitude()

setLatitude ( ?float  $latitude)

Set source latitude

Parameters
float | null$latitude
Returns
void

Implements SourceInterface.

Definition at line 141 of file Source.php.

141  : void
142  {
143  $this->setData(self::LATITUDE, $latitude);
144  }

◆ setLongitude()

setLongitude ( ?float  $longitude)

Set source longitude

Parameters
float | null$longitude
Returns
void

Implements SourceInterface.

Definition at line 159 of file Source.php.

159  : void
160  {
161  $this->setData(self::LONGITUDE, $longitude);
162  }

◆ setName()

setName ( ?string  $name)

Set source name

Parameters
string | null$name
Returns
void

Implements SourceInterface.

Definition at line 57 of file Source.php.

57  : void
58  {
59  $this->setData(self::NAME, $name);
60  }
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ setPhone()

setPhone ( ?string  $phone)

Set source phone number

Parameters
string | null$phone
Returns
void

Implements SourceInterface.

Definition at line 273 of file Source.php.

273  : void
274  {
275  $this->setData(self::PHONE, $phone);
276  }

◆ setPostcode()

setPostcode ( ?string  $postcode)

Set source post code

Parameters
string | null$postcode
Returns
void

Implements SourceInterface.

Definition at line 257 of file Source.php.

257  : void
258  {
259  $this->setData(self::POSTCODE, $postcode);
260  }

◆ setRegion()

setRegion ( ?string  $region)

Set source region title

Parameters
string | null$region
Returns
void

Implements SourceInterface.

Definition at line 209 of file Source.php.

209  : void
210  {
211  $this->setData(self::REGION, $region);
212  }

◆ setRegionId()

setRegionId ( ?int  $regionId)

Set region id if source has registered region.

Parameters
int | null$regionId
Returns
void

Implements SourceInterface.

Definition at line 193 of file Source.php.

193  : void
194  {
195  $this->setData(self::REGION_ID, $regionId);
196  }

◆ setSourceCode()

setSourceCode ( ?string  $sourceCode)

Set source code

Parameters
string | null$sourceCode
Returns
void

Implements SourceInterface.

Definition at line 41 of file Source.php.

41  : void
42  {
43  $this->setData(self::SOURCE_CODE, $sourceCode);
44  }
$sourceCode
Definition: inventory.phtml:11

◆ setStreet()

setStreet ( ?string  $street)

Set source street name

Parameters
string | null$street
Returns
void

Implements SourceInterface.

Definition at line 241 of file Source.php.

241  : void
242  {
243  $this->setData(self::STREET, $street);
244  }

◆ setUseDefaultCarrierConfig()

setUseDefaultCarrierConfig ( ?bool  $useDefaultCarrierConfig)

Parameters
bool | null$useDefaultCarrierConfig
Returns
void

Implements SourceInterface.

Definition at line 305 of file Source.php.

305  : void
306  {
307  $this->setData(self::USE_DEFAULT_CARRIER_CONFIG, $useDefaultCarrierConfig);
308  }

The documentation for this class was generated from the following file: