id = $id; if ($config) { $config = self::asArray($config); $this->location = key($config); $ex = explode(":", $this->location ); $config['storage'] = $ex[0]; $config['isoFile'] = $ex[1]; $this->setAttributes($config); } } /** * @return mixed */ public function getPath() { return $this->path; } /** * @param mixed $path */ public function setPath($path) { $this->path = $path; } /** * @return mixed */ public function getId() { return $this->id; } /** * @param mixed $id */ public function setId($id) { $this->id = $id; } /** * @return mixed */ public function getStorage() { return $this->storage; } /** * @param mixed $storage */ public function setStorage($storage) { $this->storage = $storage; } /** * @return mixed */ public function getIsoFile() { return $this->isoFile; } /** * @param mixed $isoFile */ public function setIsoFile($isoFile) { $this->isoFile = $isoFile; return $this; } /** * @return mixed */ public function getMedia() { return $this->media; } /** * @param mixed $media */ public function setMedia($media) { $this->media = $media; } /** * @return int|string|null */ public function getLocation() { return $this->location; } /** * @param int|string|null $location */ public function setLocation($location) { $this->location = $location; if(preg_match("/\:/", $location)){ $ex = explode(":", $this->location ); $this->setStorage($ex[0]); $this->setIsoFile($ex[1]); } $this->location = $location; return $this; } public function asConfig(){ $filable=['media']; $config = []; $config[]= $this->getLocation(); $this->toConfig($filable, $config); return implode(",", $config); } public function update(){ return $this->api()->put($this->getPath(), [$this->getId()=> $this->asConfig()]); } }