コード例 #1
0
ファイル: epManager.php プロジェクト: justinlyon/scc
 /**
  * Changes table name for object relations class 
  * 
  * If the second parameter is default to false, the first is the 
  * table name. Otherwise the two parameters are a pair of base 
  * classes for a relationship.
  * 
  * @param string $table_or_base_a
  * @param string $base_b
  * @return void
  */
 protected function _setRelationTable($table_or_base_a, $base_b = false)
 {
     // get relation table name (w/o prefix)
     $table = $table_or_base_a;
     if ($base_b) {
         $table = $this->getRelationTable($table_or_base_a, $base_b);
     }
     // fix bug 175: make DSN always the same as class_a or class_b
     if ($base_b) {
         // set dsn to relation table
         $this->cm_obj_rel->setDsn($this->_getRelationDsn($table_or_base_a, $base_b));
         // remove cached db for relation table
         if (isset($this->dbs[$this->cm_obj_rel->getName()])) {
             unset($this->dbs[$this->cm_obj_rel->getName()]);
         }
     }
     // set table name for relationship
     $this->cm_obj_rel->setTable($table);
 }
コード例 #2
0
 /**
  * Change table name for object relations class 
  * @param string $base_a
  * @param string $base_b
  * @return void
  */
 protected function _setRelationTable($base_a, $base_b)
 {
     $this->cm_obj_rel->setTable($this->getRelationTable($base_a, $base_b));
 }