public function test__queryFromEmptyTable() { $this->object = $this->container->get(SysEntities::TABLE_NAME); //resource name is table name $this->assertEquals(SysEntities::class, get_class($this->object)); $this->assertEquals([], $this->object->query(new Query())); }
public function install() { if (getenv('APP_ENV') === 'dev') { //develop only $tablesConfigDevelop = [TableManager::KEY_TABLES_CONFIGS => array_merge(SysEntities::getTableConfigProdaction(), StoreCatalog::$develop_tables_config)]; $tableManager = new TableManager($this->dbAdapter, $tablesConfigDevelop); $tableManager->rewriteTable(SysEntities::TABLE_NAME); $tableManager->rewriteTable(StoreCatalog::PRODUCT_TABLE_NAME); $tableManager->rewriteTable(StoreCatalog::TAG_TABLE_NAME); $tableManager->rewriteTable(StoreCatalog::MAINICON_TABLE_NAME); $tableManager->rewriteTable(StoreCatalog::MAIN_SPECIFIC_TABLE_NAME); $tableManager->rewriteTable(StoreCatalog::CATEGORY_TABLE_NAME); $tableManager->rewriteTable(StoreCatalog::PROP_LINKED_URL_TABLE_NAME); $tableManager->rewriteTable(StoreCatalog::PROP_PRODUCT_CATEGORY_TABLE_NAME); $tableManager->rewriteTable(StoreCatalog::PROP_TAG_TABLE_NAME); } else { $tablesConfigProdaction = [TableManager::KEY_TABLES_CONFIGS => SysEntities::getTableConfigProdaction()]; $tableManager = new TableManager($this->dbAdapter, $tablesConfigProdaction); $tableManager->createTable(SysEntities::TABLE_NAME); } }
public function deleteAll() { $sysEntities = new SysEntities(new TableGateway(SysEntities::TABLE_NAME, $this->dbTable->getAdapter())); return $sysEntities->deleteAllInEntity($this->getEntityName()); }
public function getPropName() { $tableName = $this->dbTable->table; return SysEntities::getPropName($tableName); }