本文整理汇总了PHP中propel\tests\bookstore\map\BookTableMap::translateFieldName方法的典型用法代码示例。如果您正苦于以下问题:PHP BookTableMap::translateFieldName方法的具体用法?PHP BookTableMap::translateFieldName怎么用?PHP BookTableMap::translateFieldName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类propel\tests\bookstore\map\BookTableMap
的用法示例。
在下文中一共展示了BookTableMap::translateFieldName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testTranslateFieldName
/**
* Tests the Base[Object]TableMap::translateFieldName() method
*/
public function testTranslateFieldName()
{
$types = array(TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME, TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM);
$expecteds = array(TableMap::TYPE_PHPNAME => 'AuthorId', TableMap::TYPE_STUDLYPHPNAME => 'authorId', TableMap::TYPE_COLNAME => 'book.AUTHOR_ID', TableMap::TYPE_FIELDNAME => 'author_id', TableMap::TYPE_NUM => 5);
foreach ($types as $fromType) {
foreach ($types as $toType) {
$name = $expecteds[$fromType];
$expected = $expecteds[$toType];
$result = BookTableMap::translateFieldName($name, $fromType, $toType);
$this->assertEquals($expected, $result);
}
}
}