Ejemplo n.º 1
0
 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()));
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
 public function deleteAll()
 {
     $sysEntities = new SysEntities(new TableGateway(SysEntities::TABLE_NAME, $this->dbTable->getAdapter()));
     return $sysEntities->deleteAllInEntity($this->getEntityName());
 }
Ejemplo n.º 4
0
 public function getPropName()
 {
     $tableName = $this->dbTable->table;
     return SysEntities::getPropName($tableName);
 }