setOptions($options); $this->_pluralModuleName = $this->_moduleName . (substr($this->_moduleName, -2) == 'ss' ? 'es' : substr($this->_moduleName, -1) != 's' ? 's' : ''); return $this; } /** * @param $options * @return App_Admin_Tool_Project_Context_File_Abstract */ 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; } /** * @abstract * @return array */ abstract public function getContext(); /** * @param bool $abstractDirectory * @param null|string $classSuffix * @param bool $abstractFile * @return string * @throws Qs_Db_Exception */ protected function _getClassName($abstractDirectory = false, $classSuffix = null, $abstractFile = false) { if ($abstractDirectory && $abstractFile) { throw new Qs_Db_Exception('$abstractDirectory and $abstractFile can not be set simultaneously.'); } if (empty($classSuffix)) { $classSuffix = $this->_classSuffix; } return str_replace(DIRECTORY_SEPARATOR, '_', $this->_baseDirectory) . '_' . (true === $abstractDirectory ? 'Abstract_' : '') . (true === $abstractFile ? 'Abstract' : ucfirst(strtolower($classSuffix))); } /** * @param string $classBase */ public function setClassBase($classBase) { $this->_classBase = $classBase; } /** * @param string $classSuffix */ public function setClassSuffix($classSuffix) { $this->_classSuffix = $classSuffix; } /** * @param string $moduleName */ public function setModuleName($moduleName) { $this->_moduleName = $moduleName; } /** * @param string $baseDirectory */ public function setBaseDirectory($baseDirectory) { $this->_baseDirectory = $baseDirectory; } }