當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Util::toCamelCase方法代碼示例

本文整理匯總了PHP中Espo\Core\Utils\Util::toCamelCase方法的典型用法代碼示例。如果您正苦於以下問題:PHP Util::toCamelCase方法的具體用法?PHP Util::toCamelCase怎麽用?PHP Util::toCamelCase使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Espo\Core\Utils\Util的用法示例。


在下文中一共展示了Util::toCamelCase方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testToCamelCase

 public function testToCamelCase()
 {
     $this->assertEquals('detail', Util::toCamelCase('detail'));
     $this->assertEquals('detailView', Util::toCamelCase('detail-view', '-'));
     $this->assertEquals('myDetailView', Util::toCamelCase('my_detail_view'));
     $input = array('detail', 'my_detail_view');
     $result = array('detail', 'myDetailView');
     $this->assertEquals($result, Util::toCamelCase($input));
 }
開發者ID:naushrambo,項目名稱:espocrm,代碼行數:9,代碼來源:UtilTest.php

示例2: convert

 public function convert($linkName, $linkParams, $entityName, $ormMeta)
 {
     $entityDefs = $this->getMetadata()->get('entityDefs');
     $foreignEntityName = $this->getLinkEntityName($entityName, $linkParams);
     $foreignLink = $this->getForeignLink($linkName, $linkParams, $entityDefs[$foreignEntityName]);
     $currentType = $linkParams['type'];
     $relType = $currentType;
     if ($foreignLink !== false) {
         $relType .= '_' . $foreignLink['params']['type'];
     }
     $relType = Util::toCamelCase($relType);
     $relationName = $this->isRelationExists($relType) ? $relType : $currentType;
     //relationDefs defined in separate file
     if (isset($linkParams['relationName'])) {
         $className = $this->getRelationClass($linkParams['relationName']);
         if (!$className) {
             $relationName = $this->isRelationExists($relType) ? $relType : $currentType;
             $className = $this->getRelationClass($relationName);
         }
     } else {
         $className = $this->getRelationClass($relationName);
     }
     if (isset($className) && $className !== false) {
         $helperClass = new $className($this->metadata, $ormMeta, $entityDefs);
         return $helperClass->process($linkName, $entityName, $foreignLink['name'], $foreignEntityName);
     }
     //END: relationDefs defined in separate file
     return null;
 }
開發者ID:disearth,項目名稱:espocrm,代碼行數:29,代碼來源:RelationManager.php

示例3: getSortEntities

 protected function getSortEntities($entity1, $entity2)
 {
     $entities = array(Util::toCamelCase(lcfirst($entity1)), Util::toCamelCase(lcfirst($entity2)));
     sort($entities);
     return $entities;
 }
開發者ID:jdavis593,項目名稱:appitechture,代碼行數:6,代碼來源:ManyMany.php


注:本文中的Espo\Core\Utils\Util::toCamelCase方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。