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


PHP Table::getCamelCaseName方法代码示例

本文整理汇总了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";
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:9,代码来源:NestedSetBehaviorQueryBuilderModifier.php

示例2: testSetCustomPhpName

 public function testSetCustomPhpName()
 {
     $table = new Table('created_at');
     $table->setPhpName('CreatedAt');
     $this->assertSame('CreatedAt', $table->getPhpName());
     $this->assertSame('createdAt', $table->getCamelCaseName());
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:7,代码来源:TableTest.php

示例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        ";
 }
开发者ID:SwissalpS,项目名称:Propel2,代码行数:18,代码来源:ObjectBuilder.php

示例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";
 }
开发者ID:disider,项目名称:Propel2,代码行数:6,代码来源:NestedSetBehaviorObjectBuilderModifier.php


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