for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace MediaMonks\SonataMediaBundle\ParameterBag;
use MediaMonks\SonataMediaBundle\Model\MediaInterface;
class ImageParameterBag extends AbstractMediaParameterBag
{
/**
* @var int
*/
protected $width;
protected $height;
* @param int $width
* @param int $height
* @param array $extra
public function __construct($width, $height, array $extra = [])
$this->width = $width;
$this->height = $height;
parent::__construct($extra);
}
* @return int
public function getWidth()
return $this->width;
public function setWidth($width)
public function getHeight()
return $this->height;
public function setHeight($height)
* @param MediaInterface $media
* @return array
public function toArray(MediaInterface $media)
return array_merge(parent::toArray($media), [
'width' => $this->getWidth(),
'height' => $this->getHeight(),
]);