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


PHP ColumnMap::isPrimaryKey方法代码示例

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


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

示例1: getValidatorClassForColumn

 /**
  * Returns a sfValidator class name for a given column.
  *
  * @param  ColumnMap $column  A ColumnMap object
  *
  * @return string    The name of a subclass of sfValidator
  */
 public function getValidatorClassForColumn(ColumnMap $column)
 {
     switch ($column->getType()) {
         case PropelColumnTypes::BOOLEAN:
             $name = 'Choice';
             break;
         case PropelColumnTypes::DOUBLE:
         case PropelColumnTypes::FLOAT:
         case PropelColumnTypes::NUMERIC:
         case PropelColumnTypes::DECIMAL:
         case PropelColumnTypes::REAL:
             $name = 'Number';
             break;
         case PropelColumnTypes::INTEGER:
         case PropelColumnTypes::SMALLINT:
         case PropelColumnTypes::TINYINT:
         case PropelColumnTypes::BIGINT:
             $name = 'Integer';
             break;
         case PropelColumnTypes::DATE:
         case PropelColumnTypes::TIME:
         case PropelColumnTypes::TIMESTAMP:
             $name = 'DateRange';
             break;
         default:
             $name = 'Pass';
     }
     if ($column->isPrimaryKey() || $column->isForeignKey()) {
         $name = 'PropelChoice';
     }
     return sprintf('sfValidator%s', $name);
 }
开发者ID:xfifix,项目名称:symfony-1.4,代码行数:39,代码来源:sfPropelFormFilterGenerator.class.php

示例2: getValidatorClassForColumn

 /**
  * Returns a sfValidator class name for a given column.
  *
  * @param  ColumnMap $column  A ColumnMap object
  *
  * @return string    The name of a subclass of sfValidator
  */
 public function getValidatorClassForColumn(ColumnMap $column)
 {
     switch ($column->getType()) {
         case PropelColumnTypes::BOOLEAN:
         case PropelColumnTypes::BOOLEAN_EMU:
             $name = 'Boolean';
             break;
         case PropelColumnTypes::CLOB:
         case PropelColumnTypes::CHAR:
         case PropelColumnTypes::VARCHAR:
         case PropelColumnTypes::LONGVARCHAR:
             $name = 'String';
             break;
         case PropelColumnTypes::DOUBLE:
         case PropelColumnTypes::FLOAT:
         case PropelColumnTypes::NUMERIC:
         case PropelColumnTypes::DECIMAL:
         case PropelColumnTypes::REAL:
             $name = 'Number';
             break;
         case PropelColumnTypes::INTEGER:
         case PropelColumnTypes::SMALLINT:
         case PropelColumnTypes::TINYINT:
         case PropelColumnTypes::BIGINT:
             $name = 'Integer';
             break;
         case PropelColumnTypes::DATE:
             $name = 'Date';
             break;
         case PropelColumnTypes::TIME:
             $name = 'Time';
             break;
         case PropelColumnTypes::TIMESTAMP:
             $name = 'DateTime';
             break;
         case PropelColumnTypes::ENUM:
             $name = 'Choice';
             break;
         default:
             $name = 'Pass';
     }
     if ($column->isForeignKey()) {
         $name = 'PropelChoice';
     } else {
         if ($column->isPrimaryKey()) {
             $name = 'Choice';
         }
     }
     return sprintf('sfValidator%s', $name);
 }
开发者ID:propelorm,项目名称:sfPropelORMPlugin,代码行数:57,代码来源:sfPropelFormGenerator.class.php


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