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


PHP StringUtils::camelize方法代码示例

本文整理汇总了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;
 }
开发者ID:wb-crowdfusion,项目名称:crowdfusion,代码行数:34,代码来源:SystemXMLConverter.php

示例2: getPrimaryKey

 public function getPrimaryKey(NodeRef $nodeRef)
 {
     return 'Table' . StringUtils::camelize($nodeRef->getElement()->Slug . 'ID');
 }
开发者ID:wb-crowdfusion,项目名称:crowdfusion,代码行数:4,代码来源:NodeDBMeta.php

示例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()'));
    }
开发者ID:wb-crowdfusion,项目名称:crowdfusion-advanced-media,代码行数:58,代码来源:ImagesCliController.php


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