url = $url; $this->height = (int) $height; $this->width = (int) $width; } /** * @return Url */ public function get_url() { return $this->url; } /** * @return int */ public function get_width() { return $this->width; } /** * @return int */ public function get_height() { return $this->height; } /** * @return string */ public function get_type() { return 'image'; } /** * @return string */ public function getOrientation() { if ($this->width > $this->height) { return self::LANDSCAPE; } else { return self::PORTRAIT; } } /** * @return bool */ public function isLandscape() { return $this->getOrientation() == self::LANDSCAPE; } /** * @return bool */ public function isPortrait() { return $this->getOrientation() == self::PORTRAIT; } }