本文整理汇总了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);
}
示例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);
}