/** * Create or update table according to schema file * * The schema file is located in ./data/ClassName.json and contains all * information required to create or alter the table. * * @param bool $prune Drop obsolete columns * @codeCoverageIgnore */ public function setSchema($prune = false) { $logger = $this->_serviceLocator->get('Library\\Logger'); $schema = \Zend\Config\Factory::fromFile(Module::getPath('data/Tables/' . $this->_getClassName() . '.json')); $database = $this->_serviceLocator->get('Database\\Nada'); $this->_preSetSchema($logger, $schema, $database, $prune); \Database\SchemaManager::setSchema($logger, $schema, $database, static::getObsoleteColumns($logger, $schema, $database), $prune); $this->_postSetSchema($logger, $schema, $database, $prune); }