Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CaseEntity.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Signifyd\Model;
7 
15 
19 class CaseEntity extends AbstractModel implements CaseInterface
20 {
24  protected $_eventPrefix = 'signifyd_case';
25 
29  private $serializer;
30 
41  public function __construct(
42  Context $context,
44  SerializerInterface $serializer,
45  array $data = [],
47  AbstractDb $resourceCollection = null
48  ) {
49  $this->serializer = $serializer;
50  parent::__construct($context, $registry, $resource, $resourceCollection, $data);
51  }
52 
56  protected function _construct()
57  {
58  $this->_init(ResourceModel\CaseEntity::class);
59  }
60 
64  public function getEntityId()
65  {
66  return (int) $this->getData('entity_id');
67  }
68 
72  public function setEntityId($id)
73  {
74  $this->setData('entity_id', (int) $id);
75  return $this;
76  }
77 
81  public function getCaseId()
82  {
83  return (int) $this->getData('case_id');
84  }
85 
89  public function setCaseId($id)
90  {
91  $this->setData('case_id', (int) $id);
92  return $this;
93  }
94 
98  public function isGuaranteeEligible()
99  {
100  $value = $this->getData('guarantee_eligible');
101  return ($value === null) ? $value : (bool) $value;
102  }
103 
107  public function setGuaranteeEligible($guaranteeEligible)
108  {
109  $this->setData('guarantee_eligible', $guaranteeEligible);
110  return $this;
111  }
112 
116  public function getGuaranteeDisposition()
117  {
118  return (string) $this->getData('guarantee_disposition');
119  }
120 
124  public function setGuaranteeDisposition($disposition)
125  {
126  $this->setData('guarantee_disposition', (string) $disposition);
127  return $this;
128  }
129 
133  public function getStatus()
134  {
135  return (string) $this->getData('status');
136  }
137 
141  public function setStatus($status)
142  {
143  $this->setData('status', (string) $status);
144  return $this;
145  }
146 
150  public function getScore()
151  {
152  return (int) $this->getData('score');
153  }
154 
158  public function setScore($score)
159  {
160  $this->setData('score', (int) $score);
161  return $this;
162  }
163 
167  public function getOrderId()
168  {
169  return (int) $this->getData('order_id');
170  }
171 
175  public function setOrderId($orderId)
176  {
177  $this->setData('order_id', (int) $orderId);
178  return $this;
179  }
180 
184  public function getAssociatedTeam()
185  {
186  $teamData = $this->getData('associated_team');
187  return empty($teamData) ? [] : $this->serializer->unserialize($teamData);
188  }
189 
193  public function setAssociatedTeam(array $team)
194  {
195  $this->setData('associated_team', $this->serializer->serialize($team));
196  return $this;
197  }
198 
202  public function getReviewDisposition()
203  {
204  return (string) $this->getData('review_disposition');
205  }
206 
210  public function setReviewDisposition($disposition)
211  {
212  $this->setData('review_disposition', (string) $disposition);
213  return $this;
214  }
215 
219  public function getCreatedAt()
220  {
221  return $this->getData('created_at');
222  }
223 
227  public function setCreatedAt($datetime)
228  {
229  $this->setData('created_at', $datetime);
230  return $this;
231  }
232 
236  public function getUpdatedAt()
237  {
238  return $this->getData('updated_at');
239  }
240 
244  public function setUpdatedAt($datetime)
245  {
246  $this->setData('updated_at', $datetime);
247  return $this;
248  }
249 }
setGuaranteeEligible($guaranteeEligible)
Definition: CaseEntity.php:107
getData($key='', $index=null)
Definition: DataObject.php:119
$id
Definition: fieldset.phtml:14
$resource
Definition: bulk.php:12
__construct(Context $context, Registry $registry, SerializerInterface $serializer, array $data=[], AbstractResource $resource=null, AbstractDb $resourceCollection=null)
Definition: CaseEntity.php:41
$value
Definition: gender.phtml:16
$status
Definition: order_status.php:8