Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ItemStatus.php
Go to the documentation of this file.
1 <?php
7 declare(strict_types=1);
8 
10 
13 
14 class ItemStatus extends DataObject implements ItemStatusInterface
15 {
19  public function getId()
20  {
21  return $this->getData(self::ENTITY_ID);
22  }
23 
27  public function setId($entityId)
28  {
29  return $this->setData(self::ENTITY_ID, $entityId);
30  }
31 
35  public function getDataHash()
36  {
37  return $this->getData(self::DATA_HASH);
38  }
39 
43  public function setDataHash($hash)
44  {
45  return $this->setData(self::DATA_HASH, $hash);
46  }
47 
51  public function getStatus()
52  {
53  return $this->getData(self::STATUS);
54  }
55 
59  public function setStatus($status = self::STATUS_ACCEPTED)
60  {
61  return $this->setData(self::STATUS, $status);
62  }
63 
67  public function getErrorMessage()
68  {
69  return $this->getData(self::ERROR_MESSAGE);
70  }
71 
75  public function setErrorMessage($errorMessage = null)
76  {
77  if ($errorMessage instanceof \Exception) {
78  $errorMessage = $errorMessage->getMessage();
79  }
80 
81  return $this->setData(self::ERROR_MESSAGE, $errorMessage);
82  }
83 
87  public function getErrorCode()
88  {
89  return $this->getData(self::ERROR_CODE);
90  }
91 
95  public function setErrorCode($errorCode = null)
96  {
97  if ($errorCode instanceof \Exception) {
98  $errorCode = $errorCode->getCode();
99  }
100 
101  return $this->setData(self::ERROR_CODE, (int) $errorCode);
102  }
103 }
getData($key='', $index=null)
Definition: DataObject.php:119
setStatus($status=self::STATUS_ACCEPTED)
Definition: ItemStatus.php:59
$status
Definition: order_status.php:8
setData($key, $value=null)
Definition: DataObject.php:72