Open
Changes from 1 commit
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Failed to load files.
Next Next commit
Add support for chrome_duration option
Add support for chrome_duration option
  • Loading branch information
@p-golovin
p-golovin authoredFeb 21, 2018
commit 26a4a53eb88da8e19c0d508268925e5db70dc407
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,6 +43,13 @@ class Chrome implements \JsonSerializable
*/
private $image;

/**
* Changes chrome push display time. Set to 0 to display push until user interacts with it
*
* @var int
*/
private $duration;

/**
* Utility function used to create a new Chrome instance.
*
Expand DownExpand Up@@ -76,7 +83,7 @@ public function getIcon()
/**
* Gets the header of the message.
*
* @var string The header of the message.
* @return string The header of the message.
*/
public function getTitle()
{
Expand All@@ -86,12 +93,22 @@ public function getTitle()
/**
* Gets the image of the message.
*
* @var string The image of the message.
* @return string The image of the message.
*/
public function getImage()
{
return $this->image;
}

/**
* Gets the duration
*
* @return int
*/
public function getDuration()
{
return $this->duration;
}

/**
* {@inheritdoc}
Expand All@@ -104,9 +121,9 @@ public function jsonSerialize()
isset($this->icon) ? $json['chrome_icon'] = $this->icon : false;
isset($this->title) ? $json['chrome_title'] = $this->title : false;
isset($this->image) ? $json['chrome_image'] = $this->image : false;
isset($this->duration) ? $json['chrome_duration'] = $this->duration : false;

return $json;

}

/**
Expand DownExpand Up@@ -164,4 +181,18 @@ public function setImage($image)

return $this;
}

/**
* Sets the duration
*
* @param $duration
*
* @return \Gomoob\Pushwoosh\Model\Notification\Chrome this instance.
*/
public function setDuration($duration)
{
$this->duration = $duration;

return $this;
}
}