function testCheckIfDoExists() { // Test when object exists $this->assertTrue(OA_Dal::checkIfDoExists('banners')); // Test when object doesn't exist $this->assertFalse(OA_Dal::checkIfDoExists('foo_1234')); }
/** * Returns context for given table name * * @param string $tableName * @return string Context */ function getContextDescription($tableName) { static $contexts = array(); if (isset($contexts[$tableName])) { return $contexts[$tableName]; } $contexts[$tableName] = $tableName; if (OA_Dal::checkIfDoExists($tableName)) { $do = OA_Dal::factoryDO($tableName); if ($do) { $contexts[$tableName] = $do->_getContext(); } } return $contexts[$tableName]; }