本文整理汇总了PHP中StringUtils::camelize方法的典型用法代码示例。如果您正苦于以下问题:PHP StringUtils::camelize方法的具体用法?PHP StringUtils::camelize怎么用?PHP StringUtils::camelize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringUtils
的用法示例。
在下文中一共展示了StringUtils::camelize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cmsNavItemToXML
public function cmsNavItemToXML(ModelObject $CMSNavItem)
{
$xml = new SimpleXMLExtended('<item/>');
$xml->addAttribute('id', $CMSNavItem->CMSNavItemID);
$xml->addAttribute('pluginid', $CMSNavItem->PluginID);
$xml->addAttribute('uri', $CMSNavItem->URI);
foreach (array('slug', 'label', 'sort_order', 'permissions') as $key) {
$camel = StringUtils::camelize($key);
if (!empty($CMSNavItem->{$camel})) {
$xml->addAttribute($key, $CMSNavItem->{$camel});
}
}
$xml->addAttribute('enabled', $CMSNavItem->isEnabled() ? 'true' : 'false');
if (!empty($CMSNavItem->DoAddLinksFor)) {
$xml->addAttribute('create_add_menu', $CMSNavItem->DoAddLinksFor);
}
// if($CMSNavItem->hasModifiedDate())
// $xml->addChild('modified_date', $this->DateFactory->toStorageDate($CMSNavItem->ModifiedDate)->toMySQLDate());
// if($CMSNavItem->hasCreationDate())
// $xml->addChild('creation_date', $this->DateFactory->toStorageDate($CMSNavItem->CreationDate)->toMySQLDate());
$sort_array = array();
$children = $CMSNavItem->getChildren();
if (!empty($children)) {
foreach ($children as $child) {
$sort_array[] = $child->SortOrder;
$sort_array2[] = $child->Slug;
}
array_multisort($sort_array, SORT_ASC, $sort_array2, SORT_ASC, $children);
foreach ($children as $child) {
$xml->addXMLElement($this->cmsNavItemToXML($child));
}
}
return $xml;
}
示例2: getPrimaryKey
public function getPrimaryKey(NodeRef $nodeRef)
{
return 'Table' . StringUtils::camelize($nodeRef->getElement()->Slug . 'ID');
}
示例3: loadNodeRefsWithMissingThumbs
/**
* Loads up all of the node refs (up to max nodes) into a temporary table.
*
* @param string $element
* @param int $maxNodes
*
* @return int - the total number of records found
*/
private function loadNodeRefsWithMissingThumbs($element, $maxNodes = 10000)
{
$this->createTempTable($element);
$tempTableName = $this->getTempTableName($element);
$cElement = StringUtils::camelize($element);
$thumbSizes = $this->MediaService->getUniqueThumbnailSizes($element);
$totalSizes = count($thumbSizes);
$tableName = str_replace('-', '_', 'n-' . $element);
$sql = array();
foreach ($thumbSizes as $thumbSize) {
$sql[] = <<<EOL
(
SELECT
IF(COUNT(1),1,0)
FROM
{$tableName}_outtags b
WHERE
b.Table{$cElement}ID = a.Table{$cElement}ID
AND b.Role = 'thumbnails'
AND b.Value = '{$thumbSize}'
)
EOL;
}
$sql = implode('+', $sql);
$sql = <<<EOL
INSERT IGNORE INTO {$tempTableName}
(slug)
SELECT
SQL_CALC_FOUND_ROWS
Slug
FROM
(
SELECT
a.Slug, a.Table{$cElement}ID
FROM
{$tableName} a
WHERE
a.Status <> 'deleted'
AND {$totalSizes} > ({$sql})
) as T1
ORDER BY
Table{$cElement}ID DESC
LIMIT
{$maxNodes}
EOL;
$this->Logger->info($sql);
$db = $this->getDBConnection();
$db->write($sql, DatabaseInterface::AFFECTED_ROWS);
return intVal($db->readField('SELECT FOUND_ROWS()'));
}