Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Customer.php
Go to the documentation of this file.
1 <?php
8 
9 use \Magento\Framework\Api\AttributeValueFactory;
10 
17 {
21  protected $metadataService;
22 
31  public function __construct(
32  \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
35  $data = []
36  ) {
37  $this->metadataService = $metadataService;
38  parent::__construct($extensionFactory, $attributeValueFactory, $data);
39  }
40 
44  protected function getCustomAttributesCodes()
45  {
46  if ($this->customAttributesCodes === null) {
47  $this->customAttributesCodes = $this->getEavAttributesCodes($this->metadataService);
48  }
50  }
51 
55  public function getDefaultBilling()
56  {
57  return $this->_get(self::DEFAULT_BILLING);
58  }
59 
65  public function getDefaultShipping()
66  {
67  return $this->_get(self::DEFAULT_SHIPPING);
68  }
69 
75  public function getConfirmation()
76  {
77  return $this->_get(self::CONFIRMATION);
78  }
79 
85  public function getCreatedAt()
86  {
87  return $this->_get(self::CREATED_AT);
88  }
89 
95  public function getCreatedIn()
96  {
97  return $this->_get(self::CREATED_IN);
98  }
99 
105  public function getUpdatedAt()
106  {
107  return $this->_get(self::UPDATED_AT);
108  }
109 
115  public function getDob()
116  {
117  return $this->_get(self::DOB);
118  }
119 
125  public function getEmail()
126  {
127  return $this->_get(self::EMAIL);
128  }
129 
135  public function getFirstname()
136  {
137  return $this->_get(self::FIRSTNAME);
138  }
139 
145  public function getGender()
146  {
147  return $this->_get(self::GENDER);
148  }
149 
155  public function getGroupId()
156  {
157  return $this->_get(self::GROUP_ID);
158  }
159 
165  public function getId()
166  {
167  return $this->_get(self::ID);
168  }
169 
175  public function getLastname()
176  {
177  return $this->_get(self::LASTNAME);
178  }
179 
185  public function getMiddlename()
186  {
187  return $this->_get(self::MIDDLENAME);
188  }
189 
195  public function getPrefix()
196  {
197  return $this->_get(self::PREFIX);
198  }
199 
205  public function getStoreId()
206  {
207  return $this->_get(self::STORE_ID);
208  }
209 
215  public function getSuffix()
216  {
217  return $this->_get(self::SUFFIX);
218  }
219 
225  public function getTaxvat()
226  {
227  return $this->_get(self::TAXVAT);
228  }
229 
235  public function getWebsiteId()
236  {
237  return $this->_get(self::WEBSITE_ID);
238  }
239 
245  public function getAddresses()
246  {
247  return $this->_get(self::KEY_ADDRESSES);
248  }
249 
255  public function getDisableAutoGroupChange()
256  {
257  return $this->_get(self::DISABLE_AUTO_GROUP_CHANGE);
258  }
259 
266  public function setId($id)
267  {
268  return $this->setData(self::ID, $id);
269  }
270 
277  public function setGroupId($groupId)
278  {
279  return $this->setData(self::GROUP_ID, $groupId);
280  }
281 
288  public function setDefaultBilling($defaultBilling)
289  {
290  return $this->setData(self::DEFAULT_BILLING, $defaultBilling);
291  }
292 
299  public function setDefaultShipping($defaultShipping)
300  {
301  return $this->setData(self::DEFAULT_SHIPPING, $defaultShipping);
302  }
303 
310  public function setConfirmation($confirmation)
311  {
312  return $this->setData(self::CONFIRMATION, $confirmation);
313  }
314 
321  public function setCreatedAt($createdAt)
322  {
323  return $this->setData(self::CREATED_AT, $createdAt);
324  }
325 
332  public function setUpdatedAt($updatedAt)
333  {
334  return $this->setData(self::UPDATED_AT, $updatedAt);
335  }
336 
343  public function setCreatedIn($createdIn)
344  {
345  return $this->setData(self::CREATED_IN, $createdIn);
346  }
347 
354  public function setDob($dob)
355  {
356  return $this->setData(self::DOB, $dob);
357  }
358 
365  public function setEmail($email)
366  {
367  return $this->setData(self::EMAIL, $email);
368  }
369 
376  public function setFirstname($firstname)
377  {
378  return $this->setData(self::FIRSTNAME, $firstname);
379  }
380 
387  public function setLastname($lastname)
388  {
389  return $this->setData(self::LASTNAME, $lastname);
390  }
391 
398  public function setMiddlename($middlename)
399  {
400  return $this->setData(self::MIDDLENAME, $middlename);
401  }
402 
409  public function setPrefix($prefix)
410  {
411  return $this->setData(self::PREFIX, $prefix);
412  }
413 
420  public function setSuffix($suffix)
421  {
422  return $this->setData(self::SUFFIX, $suffix);
423  }
424 
431  public function setGender($gender)
432  {
433  return $this->setData(self::GENDER, $gender);
434  }
435 
442  public function setStoreId($storeId)
443  {
444  return $this->setData(self::STORE_ID, $storeId);
445  }
446 
453  public function setTaxvat($taxvat)
454  {
455  return $this->setData(self::TAXVAT, $taxvat);
456  }
457 
464  public function setWebsiteId($websiteId)
465  {
466  return $this->setData(self::WEBSITE_ID, $websiteId);
467  }
468 
475  public function setAddresses(array $addresses = null)
476  {
477  return $this->setData(self::KEY_ADDRESSES, $addresses);
478  }
479 
486  public function setDisableAutoGroupChange($disableAutoGroupChange)
487  {
488  return $this->setData(self::DISABLE_AUTO_GROUP_CHANGE, $disableAutoGroupChange);
489  }
490 
496  public function getExtensionAttributes()
497  {
498  return $this->_getExtensionAttributes();
499  }
500 
507  public function setExtensionAttributes(\Magento\Customer\Api\Data\CustomerExtensionInterface $extensionAttributes)
508  {
509  return $this->_setExtensionAttributes($extensionAttributes);
510  }
511 }
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
$suffix
Definition: name.phtml:27
$email
Definition: details.phtml:13
setExtensionAttributes(\Magento\Customer\Api\Data\CustomerExtensionInterface $extensionAttributes)
Definition: Customer.php:507
$id
Definition: fieldset.phtml:14
setDisableAutoGroupChange($disableAutoGroupChange)
Definition: Customer.php:486
$addresses
Definition: address_list.php:7
$prefix
Definition: name.phtml:25
$extensionAttributes
Definition: payment.php:22
setAddresses(array $addresses=null)
Definition: Customer.php:475
setDefaultShipping($defaultShipping)
Definition: Customer.php:299
__construct(\Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $attributeValueFactory, \Magento\Customer\Api\CustomerMetadataInterface $metadataService, $data=[])
Definition: Customer.php:31