public function setWidth($width) { if (!empty($width) && is_numeric($width)) { $this->width = intval($width); } else { $this->width = $width; } return $this; }