public function __construct($image = null, $name = null, $full_path = null, $size = null, $content_type = null, $is_image = null) { if (is_null($image) && !is_null($full_path)) { $image = self::createResource($full_path); } if (is_resource($image) && get_resource_type($image) === 'gd') { parent::__construct($image); } $this->name = $name; $this->full_path = $full_path; $this->size = $size; $this->content_type = $content_type; }