name = $name; $this->path = $path; $this->options = $options; } public function getName() { return $this->name; } public function copyTo($destination) { // check if Pictures directory exists in the destination if (!is_dir($destination . 'Pictures')) { mkdir($destination . 'Pictures'); } $out = 'Pictures' . DIRECTORY_SEPARATOR . basename($this->path); @ copy($this->path, $destination . $out); // return xlink:href return $out; } public function getWidth($default) { if (isset ($this->options['width'])) { return $this->options['width']; } else { return $default; } } public function getHeight($default) { if (isset ($this->options['height'])) { return $this->options['height']; } else { return $default; } } }