public function addTableResolver($packagePath, GitPackageConfigDatabase $db)
 {
     if (!is_dir($packagePath)) {
         mkdir($packagePath);
     }
     $resolver = $packagePath . '/gpm.resolve.tables.php';
     if (file_exists($resolver)) {
         unlink($resolver);
     }
     $this->smarty->assign('tables', $db->getTables());
     $this->smarty->assign('prefix', $db->getPrefix());
     $resolverContent = $this->smarty->fetch('tables_resolver.tpl');
     file_put_contents($resolver, $resolverContent);
     return $this->addPHPResolver($resolver);
 }
 /**
  * Parse and validate database information
  * @param $database
  * @return bool
  */
 private function setDatabase($database)
 {
     $this->database = new GitPackageConfigDatabase($this->modx);
     if ($this->database->fromArray($database) == false) {
         return false;
     }
     return true;
 }