public static function hasDataObjects($groupId) { //$db = ZitDBAdapter::getDBAdapter(); $db = Zend_Registry::get('my_db2'); $do = new DataObjects($db); $result = $do->fetchAll("group_id = {$groupId}"); if ($result->count() != 0) { return true; } else { return true; } }
public function __construct() { parent::__construct(); }
public static function objectExists($objectName) { $db = Zend_Registry::get('my_db'); $do = new DataObjects($db); $quoted = $db->quote($objectName); $where = "lower(object_name) = lower({$quoted}) and version_id = " . $_SESSION['ZONE_VERSION_ID']; $result = $do->fetchAll($where); $rows = $result->count(); if ($rows == 1) { return true; } else { return false; } }
/** * instance singleton self (PDO) * @access protected */ private static function PDOInstance() { if (!isset(self::$PDOInstance)) { if (is_null(self::$PDOInstance)) { try { self::$PDOInstance = new PDO(self::getInfo()->getconnStr(), self::getInfo()->getuser(), self::getInfo()->getpass()); self::$PDOInstance->exec("SET CHARACTER SET utf8"); } catch (PDOException $e) { self::$PDOInstance = false; die($e->getMessage()); } } } return self::$PDOInstance; }