Commit 936aea04 authored by stephane's avatar stephane
Browse files

[Client] Added parameters "width" and "height" to Entity::File::getThumbnail

git-svn-id: https://svn.libcast.net/libcast/component/Client/branches/2.1@5777 59603aea-79bc-4624-862a-e4db60f57f7e
parent ff391079
......@@ -8,7 +8,7 @@ use JMS\Serializer\Annotation\Type;
use JMS\Serializer\Annotation\XmlRoot;
/**
*
*
* @XmlRoot("file")
*/
class File extends Entity implements FileInterface
......@@ -49,7 +49,7 @@ class File extends Entity implements FileInterface
protected $thumbnail;
/**
*
*
* @return string
*/
public function getName()
......@@ -68,7 +68,7 @@ class File extends Entity implements FileInterface
}
/**
*
*
* @return ???
*/
public function getEncodingStatus()
......@@ -79,16 +79,30 @@ class File extends Entity implements FileInterface
/**
* URL of the thumbnail
*
* You can change the size of pointed thumbnail py providing width and height parameters
*
* @param int $width The width of the thumbnail
* @param int $height The height of the thumbnail
*
* @return string
*/
public function getThumbnail()
public function getThumbnail($height = null, $width = null)
{
if ($height)
{
$this->thumbnail = substr($this->thumbnail, 0, strrpos($this->thumbnail, "/")).'/height/'.$height.substr($this->thumbnail, strrpos($this->thumbnail, "/"));
}
if ($width)
{
$this->thumbnail = substr($this->thumbnail, 0, strrpos($this->thumbnail, "/")).'/width/'.$width.substr($this->thumbnail, strrpos($this->thumbnail, "/"));
}
return $this->thumbnail;
}
/**
* Code of the embed (URL encoded)
*
*
* @return string
*/
public function getEmbed()
......
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