本文整理汇总了PHP中Propel\Generator\Model\Table::getCamelCaseName方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::getCamelCaseName方法的具体用法?PHP Table::getCamelCaseName怎么用?PHP Table::getCamelCaseName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Generator\Model\Table
的用法示例。
在下文中一共展示了Table::getCamelCaseName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addRootsOf
protected function addRootsOf(&$script)
{
$objectName = '$' . $this->table->getCamelCaseName();
$script .= "\n/**\n * Filter the query to restrict the result to roots of an object.\n * Same as ancestorsOf(), except that it includes the object passed as parameter in the result\n *\n * @param {$this->objectClassName} {$objectName} The object to use for roots search\n *\n * @return \$this|{$this->queryClassName} The current query, for fluid interface\n */\npublic function rootsOf({$this->objectClassName} {$objectName})\n{\n return \$this";
if ($this->behavior->useScope()) {
$script .= "\n ->inTree({$objectName}->getScopeValue())";
}
$script .= "\n ->addUsingAlias({$this->objectClassName}::LEFT_COL, {$objectName}->getLeftValue(), Criteria::LESS_EQUAL)\n ->addUsingAlias({$this->objectClassName}::RIGHT_COL, {$objectName}->getRightValue(), Criteria::GREATER_EQUAL);\n}\n";
}
示例2: testSetCustomPhpName
public function testSetCustomPhpName()
{
$table = new Table('created_at');
$table->setPhpName('CreatedAt');
$this->assertSame('CreatedAt', $table->getPhpName());
$this->assertSame('createdAt', $table->getCamelCaseName());
}
示例3: addToArrayKeyLookUp
/**
* Adds the switch-statement for looking up the array-key name for toArray
* @see toArray
*/
protected function addToArrayKeyLookUp($phpName, Table $table, $plural)
{
if ($phpName == "") {
$phpName = $table->getPhpName();
}
$camelCaseName = $table->getCamelCaseName();
$fieldName = $table->getName();
if ($plural) {
$phpName = $this->getPluralizer()->getPluralForm($phpName);
$camelCaseName = $this->getPluralizer()->getPluralForm($camelCaseName);
$fieldName = $this->getPluralizer()->getPluralForm($fieldName);
}
return "\n switch (\$keyType) {\n case TableMap::TYPE_CAMELNAME:\n \$key = '" . $camelCaseName . "';\n break;\n case TableMap::TYPE_FIELDNAME:\n \$key = '" . $fieldName . "';\n break;\n default:\n \$key = '" . $phpName . "';\n }\n ";
}
示例4: addNestedSetChildAdd
protected function addNestedSetChildAdd(&$script)
{
$objectClassName = $this->builder->getObjectClassName();
$objectName = '$' . $this->table->getCamelCaseName();
$script .= "\n/**\n * Adds an element to the internal \$collNestedSetChildren collection.\n * Beware that this doesn't insert a node in the tree.\n * This method is only used to facilitate children hydration.\n *\n * @param {$objectClassName} {$objectName}\n *\n * @return void\n */\npublic function addNestedSetChild({$objectClassName} {$objectName})\n{\n if (null === \$this->collNestedSetChildren) {\n \$this->initNestedSetChildren();\n }\n if (!in_array({$objectName}, \$this->collNestedSetChildren->getArrayCopy(), true)) { // only add it if the **same** object is not already associated\n \$this->collNestedSetChildren[]= {$objectName};\n {$objectName}->setParent(\$this);\n }\n}\n";
}