path = $origin; $this->destination = $config->paths->media; $this->destination .= $this->_id; } public function onSave(){ try{ if(!is_dir($this->destination)){ SFSManager::createDirectory($this->destination); } SFSManager::copyFile($this->path, $this->destination.=$this->_id); }catch(SFSException $ex){ throw new CoreException("Error while saving model with id '".$this->_id. "' ".$ex->getMessage()); } } } ?>