Commit af77d5b5 authored by keven's avatar keven
Browse files

Added media() relation on entity Stream

parent d815f330
......@@ -43,6 +43,19 @@ class Stream extends Entity implements StreamInterface
*/
protected $visibility = 'visible';
/**
* @SerializedName("media")
* @Type("Libcast\Client\Entity\Link")
*/
protected $hrefMedia;
/**
*
* @Exclude
* @var \Libcast\Client\Model\MediaInterface
*/
protected $_media;
/**
* @SerializedName("parent_stream")
* @Type("Libcast\Client\Entity\Link")
......@@ -180,6 +193,22 @@ class Stream extends Entity implements StreamInterface
$this->visibility = $visibility;
}
/**
*
* @return \Libcast\Client\Model\MediaInterface
*/
public function media()
{
if (!$this->_media)
{
if ($this->hrefMedia and $this->client) {
$this->_media = $this->client->media($this->hrefMedia->href);
}
}
return $this->_media;
}
/**
*
* @return boolean
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment