当前位置: 首页>>代码示例>>PHP>>正文


PHP ColumnMap::getRelatedTableName方法代码示例

本文整理汇总了PHP中ColumnMap::getRelatedTableName方法的典型用法代码示例。如果您正苦于以下问题:PHP ColumnMap::getRelatedTableName方法的具体用法?PHP ColumnMap::getRelatedTableName怎么用?PHP ColumnMap::getRelatedTableName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ColumnMap的用法示例。


在下文中一共展示了ColumnMap::getRelatedTableName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addCIRValidation

 public static function addCIRValidation(TableMap $map, ColumnMap $column, $message = null)
 {
     $columnName = $column->getColumnName();
     $value = $column->getRelatedTableName();
     if (!isset($message)) {
         $message = $value . " non trouvé";
     }
     $map->addValidator($columnName, "class", "utils.CIRValidator", $value, $message);
 }
开发者ID:sandrineBeauche,项目名称:cookbookServer,代码行数:9,代码来源:CIRPeerUtils.php

示例2: getForeignTable

 /**
  * Returns the foreign table associated with a column.
  *
  * @param  ColumnMap $column A ColumnMap object
  *
  * @return TableMap  A TableMap object
  */
 public function getForeignTable(ColumnMap $column)
 {
     return $this->dbMap->getTable($column->getRelatedTableName());
 }
开发者ID:broschb,项目名称:cyclebrain,代码行数:11,代码来源:sfPropelFormGenerator.class.php

示例3: getRowValue

 /**
  * Gets value for row table
  * 
  * Swaps foreign creator_node_id values for their unique FQDN value. Note that the other
  * part(s) to a primary or foreign key is set by the creator and is the same in all nodes,
  * so may be hashed without causing difference problems between nodes.
  * 
  * @todo Better node table detection required (should use known prefix)
  * @todo Fix column name hardwiring
  * 
  * @param MeshingBaseObject $object
  * @param ColumnMap $columnMap
  * @return mixed 
  */
 protected function getRowValue(MeshingBaseObject $object, ColumnMap $columnMap)
 {
     // Get value for this column
     $columnName = $columnMap->getName();
     $value = $object->getByName($columnName, BasePeer::TYPE_RAW_COLNAME);
     // If the related table name ends with '_known_node' then we assume this is a
     // FK to a creator node ID.
     if ($columnMap->isForeignKey()) {
         $match = '_known_node';
         $isNodeTable = $match == substr($columnMap->getRelatedTableName(), -strlen($match));
         if ($isNodeTable && $columnMap->getRelatedColumnName() == 'ID') {
             $nodePeerName = $columnMap->getRelation()->getForeignTable()->getPeerClassname();
             $node = call_user_func(array($nodePeerName, 'retrieveByPK'), $value, $this->con);
             // If there is no related node, we really do have problems!
             if (!$node) {
                 $primaryKey = $object->getPrimaryKey();
                 if (is_array($primaryKey)) {
                     $primaryKey = '{' . implode(',', $primaryKey) . '}';
                 }
                 $type = get_class($object);
                 throw new Exception("Row {$primaryKey} in table '{$type}' points to a non-existent node row");
             }
             $value = $node->getFqdn();
         }
     }
     return $value;
 }
开发者ID:halfer,项目名称:Meshing,代码行数:41,代码来源:Basic.php


注:本文中的ColumnMap::getRelatedTableName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。