Пример #1
0
 public function __construct($package, $generate)
 {
     if (!isset($package) || !in_array($package, ['app', 'bus', 'cms', 'core'])) {
         Error::kill(Error::INVALID_PARAMETERS, '$package cannot be null and must be either app, bus, cms or core', __FILE__, __LINE__);
     }
     $this->info = [];
     $this->package = ucfirst(strtolower($package));
     $this->generate = $generate;
     $this->xmlModel = new \DOMDocument();
     $this->xmlModel->formatOutput = true;
     $this->xmlModel->preserveWhiteSpace = false;
     $modelPath = \Rebond\Config::getPath('model') . $package . '.xml';
     if (!file_exists($modelPath)) {
         Error::killException(Error::XML_MODEL_NOT_FOUND, $modelPath, __FILE__, __LINE__);
     }
     $this->xmlModel->load($modelPath);
 }