'Please set _filesystemName', self::ERROR_BASE_DIRECTORY_IS_NULL => 'Please set _baseDirectory', self::ERROR_MODULE_NAME_IS_NULL => 'Please set _moduleName' ); public function __construct(array $options = array()) { $this->setOptions($options); return $this; } public function setOptions($options) { if (isset($options['options'])) { unset($options['options']); } foreach ($options as $key => $value) { $method = 'set' . ucfirst($key); if (method_exists($this, $method)) { $this->$method($value); } else { $this->_options[$key] = $value; } } return $this; } public function setBaseDirectory($baseDirectory) { $this->_baseDirectory = rtrim(str_replace('\\', DIRECTORY_SEPARATOR, $baseDirectory), DIRECTORY_SEPARATOR); return $this; } public function getBaseDirectory() { return $this->_baseDirectory; } public function setFilesystemName($filesystemName) { $this->_filesystemName = $filesystemName; return $this; } public function getFilesystemName() { return $this->_filesystemName; } public function getPath() { $path = $this->getBaseDirectory(); if ($this->getFilesystemName()) { $path .= '/' . $this->getFilesystemName(); } return $path; } public function setFullPath($fullPath) { $this->_fullPath = $fullPath; } public function getFullPath() { if (empty($this->_fullPath)) { return BASE_PATH . '/' . $this->getPath(); } return $this->_fullPath; } public function setModuleName($moduleName) { $this->_moduleName = $moduleName; } public function getModuleName() { return $this->_moduleName; } }