예제 #1
0
 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;
     }
 }
예제 #2
0
 public function __construct()
 {
     parent::__construct();
 }
예제 #3
0
 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;
     }
 }
예제 #4
0
 /**
  * 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;
 }