1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29:
<?php
namespace Scene7\Commands;
trait Height
{
/**
* @param int $height
* @return $this
*/
public function setHeight($height)
{
$height = (int) $height;
if ($height < 1) {
throw new \InvalidArgumentException('Height must be an integer greater than 0');
}
$this->addCommand(['hei' => $height]);
return $this;
}
/**
* @return null|int
*/
public function getHeight()
{
return isset($this->commands['hei']) ? $this->commands['hei'] : null;
}
}