dmBridge PHP API
UNLVRandomObject.php
00001 <?php
00002 #
00003 # UNLVRandom: a dmBridge module for random objects
00004 #
00005 # Copyright © 2011 Board of Regents of the Nevada System of Higher
00006 # Education, on behalf of the University of Nevada, Las Vegas
00007 #
00008 
00015 abstract class UNLVRandomObject {
00016 
00017    public static function getRandomObject() {
00018       $ds = self::getDataStore();
00019       return ($ds) ? $ds->getRandomObject() : null;
00020    }
00021 
00022    public static function getDataStore() {
00023       $ds = DMDataStoreFactory::getDataStore();
00024       switch ($ds->getType()) {
00025          case DMDataStoreType::PDO_MySQL:
00026             $ds = UNLVRandomMySQLDataStore::getInstance();
00027             break;
00028          case DMDataStoreType::PDO_SQLite:
00029             $ds = UNLVRandomSQLiteDataStore::getInstance();
00030             break;
00031       }
00032       return $ds;
00033    }
00034 
00035 }
00036 
 All Data Structures Functions Variables