gyro/core/model/base/dbtablerepository.cls.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * Centralized repository of table definitions 00004 * 00005 * @author Gerd Riesselmann 00006 * @ingroup Model 00007 */ 00008 class DBTableRepository { 00009 static $tables = array(); 00010 00011 public static function register(IDBTable $table, $name = false) { 00012 if (empty($name)) { 00013 $name = $table->get_table_name(); 00014 } 00015 self::$tables[$name] = $table; 00016 } 00017 00018 public static function get($name) { 00019 return Arr::get_item(self::$tables, $name, false); 00020 } 00021 }