예제 #1
0
 public function __construct($config = array())
 {
     if (!isset(self::$_instance[get_class($this)])) {
         self::$_instance[get_class($this)] = 0;
     }
     if (self::$_instance[get_class($this)] == 0) {
         $this->_createTable();
     }
     self::$_instance[get_class($this)]++;
     parent::__construct($config);
 }
예제 #2
0
 public function testGenRefRuleName()
 {
     $table = new Centurion_Db_Table();
     $uniqName = $table->testGenRefRuleName('name');
     $this->assertEquals('name', $uniqName);
     //This had cause infinite loop because no name was given
     $table->setDependentTables(array('Centurion_Db_Table'));
     $uniqName = $table->testGenRefRuleName('name');
     $table->setReferences(array('name' => array('columns' => 'test_id', 'refColumns' => 'id', 'refTableClass' => 'Centurion_Db_Table')));
     //We must have something else than name
     $uniqName = $table->testGenRefRuleName('name');
     $this->assertNotEquals('name', $uniqName);
 }