/** * Initialize the database object. * @throws AiryException The exception is thrown for database mapping. */ public function initialDB() { $multiDb = DbConfig::getConfig(); $acl = AclUtility::getInstance(); $this->acDbArray = $multiDb; //set a default value for acDb $moduleName = MvcReg::getModuleName(); $mapTableId = $acl->getTableIdByModule($moduleName); $mapDbId = $acl->getMapDatabaseId($mapTableId); if (isset($this->acDbArray[$mapDbId])) { $this->acDb = $this->acDbArray[$mapDbId]; } else { throw new AiryException("Acl Xml database mapping is wrong, check 'mapping_database_id' value or your config.ini"); } }
function __construct() { $this->adapter = new DbAdapter(DbConfig::getConfig()); $this->auctionService = new AuctionService($this->adapter); }
/** * Sets multiple databases configs. * * @param int $databaseId * @param array $config */ public function setMultiDb($databaseId, $config) { $this->multiDb = DbConfig::getConfig(); $this->db = DbConfig::assignDbAccess($databaseId, $config); }