dmBridge PHP API
UNLVSpatial.php
00001 <?php
00002 #
00003 # UNLVSpatial: a dmBridge module for spatial content
00004 #
00005 # Copyright © 2009, 2010, 2011 Board of Regents of the Nevada System of Higher
00006 # Education, on behalf of the University of Nevada, Las Vegas
00007 #
00008 
00020 class UNLVSpatial extends DMAbstractDMBridgeModule
00021 implements DMBridgeControlPanelModule, DMBridgeDataStoreModule,
00022       DMBridgeRepresentationSchemaModule, DMBridgeTemplateHelperModule {
00023 
00024    private $template_helper;
00025 
00029    public static function getDataStore() {
00030       $ds = DMDataStoreFactory::getDataStore();
00031       switch ($ds->getType()) {
00032       case DMDataStoreType::PDO_MySQL:
00033          $ds = UNLVSpatialMySQLDataStore::getInstance();
00034          break;
00035       case DMDataStoreType::PDO_SQLite:
00036          $ds = UNLVSpatialSQLiteDataStore::getInstance();
00037          break;
00038       }
00039       return $ds;
00040    }
00041 
00045    public function getControlPanelMenuSections() {
00046       $sections = array();
00047 
00048       $section = new DMCPMenuSection("Spatial Objects");
00049 
00050       $item = new DMCPMenuItem(
00051             "Index",
00052             DMInternalURI::getURIWithParams("admin/spatial_objects"));
00053       $section->addMenuItem($item);
00054 
00055       $sections[] = $section;
00056       return $sections;
00057    }
00058 
00062    public function getMinSupportedVersionSequence() {
00063       return 12;
00064    }
00065 
00069    public function getName() {
00070       return "UNLVSpatial";
00071    }
00072 
00076    public function getPathToSchemas() {
00077       return $this->getAbsolutePathname() . "/schema";
00078    }
00079 
00087    public function getSetupSQLForMySQL() {
00088       return UNLVSpatialMySQLDataStore::getSetupSQL();
00089    }
00090 
00098    public function getSetupSQLForSQLite() {
00099       return UNLVSpatialSQLiteDataStore::getSetupSQL();
00100    }
00101 
00107    public function getSupportedDataStores() {
00108       return array(
00109          DMDataStoreType::PDO_MySQL,
00110          DMDataStoreType::PDO_SQLite
00111       );
00112    }
00113 
00119    public function getTemplateHelper(DMAbstractView $view,
00120          DMSession $session) {
00121       if (!$this->template_helper
00122             || !$this->template_helper->getView() instanceof $view) {
00123          $this->template_helper = new UNLVSpatialTemplateHelper($view,
00124                $session);
00125       }
00126       return $this->template_helper;
00127    }
00128 
00138    public function getUpgradeSQLForMySQL() {
00139       return UNLVSpatialMySQLDataStore::getUpgradeSQL();
00140    }
00141 
00151    public function getUpgradeSQLForSQLite() {
00152       return UNLVSpatialSQLiteDataStore::getUpgradeSQL();
00153    }
00154 
00158    public function getVersion() {
00159       return "1.0";
00160    }
00161 
00162 }
00163 
 All Data Structures Functions Variables