Skip to content

Commit

Permalink
Add createdAt & URL
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkVaughn committed Jul 11, 2018
1 parent 4701c02 commit 1aa99b5
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
44 changes: 44 additions & 0 deletions php/src/Snagshout/Promote/Model/ReviewFoundRequestBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

class ReviewFoundRequestBody
{
/**
* @var string
*/
protected $createdAt;
/**
* @var string
*/
Expand All @@ -29,10 +33,32 @@ class ReviewFoundRequestBody
* @var string
*/
protected $reviewId;
/**
* @var string
*/
protected $url;
/**
* @var int
*/
protected $stars;
/**
* @return string
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @param string $createdAt
*
* @return self
*/
public function setCreatedAt($createdAt = null)
{
$this->createdAt = $createdAt;

return $this;
}
/**
* @return string
*/
Expand Down Expand Up @@ -105,6 +131,24 @@ public function setReviewId($reviewId = null)

return $this;
}
/**
* @return string
*/
public function getUrl()
{
return $this->url;
}
/**
* @param string $url
*
* @return self
*/
public function setUrl($url = null)
{
$this->url = $url;

return $this;
}
/**
* @return int
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public function supportsNormalization($data, $format = null)
public function denormalize($data, $class, $format = null, array $context = [])
{
$object = new \Snagshout\Promote\Model\ReviewFoundRequestBody();
if (property_exists($data, 'createdAt')) {
$object->setCreatedAt($data->{'createdAt'});
}
if (property_exists($data, 'title')) {
$object->setTitle($data->{'title'});
}
Expand All @@ -48,6 +51,9 @@ public function denormalize($data, $class, $format = null, array $context = [])
if (property_exists($data, 'reviewId')) {
$object->setReviewId($data->{'reviewId'});
}
if (property_exists($data, 'url')) {
$object->setUrl($data->{'url'});
}
if (property_exists($data, 'stars')) {
$object->setStars($data->{'stars'});
}
Expand All @@ -57,6 +63,9 @@ public function denormalize($data, $class, $format = null, array $context = [])
public function normalize($object, $format = null, array $context = [])
{
$data = new \stdClass();
if (null !== $object->getCreatedAt()) {
$data->{'createdAt'} = $object->getCreatedAt();
}
if (null !== $object->getTitle()) {
$data->{'title'} = $object->getTitle();
}
Expand All @@ -69,6 +78,9 @@ public function normalize($object, $format = null, array $context = [])
if (null !== $object->getReviewId()) {
$data->{'reviewId'} = $object->getReviewId();
}
if (null !== $object->getUrl()) {
$data->{'url'} = $object->getUrl();
}
if (null !== $object->getStars()) {
$data->{'stars'} = $object->getStars();
}
Expand Down

0 comments on commit 1aa99b5

Please sign in to comment.