本文整理汇总了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));
}
示例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;
}
示例3: getSortEntities
protected function getSortEntities($entity1, $entity2)
{
$entities = array(Util::toCamelCase(lcfirst($entity1)), Util::toCamelCase(lcfirst($entity2)));
sort($entities);
return $entities;
}