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


PHP eZURL::create方法代码示例

本文整理汇总了PHP中eZURL::create方法的典型用法代码示例。如果您正苦于以下问题:PHP eZURL::create方法的具体用法?PHP eZURL::create怎么用?PHP eZURL::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZURL的用法示例。


在下文中一共展示了eZURL::create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testFetchByUrl

 /**
  * @group ezurl
  */
 public function testFetchByUrl()
 {
     $url = 'http://ez.no/ezpublish';
     $urlObj = eZURL::create($url);
     $urlObj->store();
     $urlObj2 = eZURL::fetchByUrl($url);
     self::assertInstanceOf('eZURL', $urlObj2);
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:11,代码来源:ezurl_test.php

示例2: registerURLArray

    static function registerURLArray( $urlArray )
    {
        $db = eZDB::instance();

        foreach( $urlArray as $key => $url )
        {
            $urlArrayTmp[$key] = $db->escapeString( $url );
        }
        // Fetch the already existing URL's
        $inURLSQL = implode( '\', \'', $urlArrayTmp );
        $checkURLQuery = "SELECT id, url FROM ezurl WHERE url IN ( '$inURLSQL' )";
        $urlRowArray = $db->arrayQuery( $checkURLQuery );

        $registeredURLArray = array();
        foreach ( $urlRowArray as $urlRow )
        {
            $registeredURLArray[$urlRow['url']] = $urlRow['id'];
        }

        // Check for URL's which are not registered, and register them
        foreach ( $urlArray as $url )
        {
            if ( !isset( $registeredURLArray[$url] ) )
            {
                $url = eZURL::create( $url );
                $url->store();
                $urlID = $url->attribute( 'id' );
                $urlText = $url->attribute('url' );
                $registeredURLArray[$urlText] = $urlID;
            }
        }

        return $registeredURLArray;
    }
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:34,代码来源:ezurl.php

示例3: unserializeContentObjectAttribute

 function unserializeContentObjectAttribute($package, $objectAttribute, $attributeNode)
 {
     /* For all links found in the XML, do the following:
      * Search for url specified in 'href' link attribute (in ezurl table).
      * If the url not found then create a new one.
      * Then associate the found (or created) URL with the object attribute by creating new url-object link.
      * After that, remove "href" attribute, add new "id" attribute.
      * This new 'id' will always refer to the existing url object.
      */
     $linkNodes = $attributeNode->getElementsByTagName('link');
     foreach ($linkNodes as $linkNode) {
         $href = $linkNode->getAttribute('href');
         if (!$href) {
             continue;
         }
         $urlObj = eZURL::urlByURL($href);
         if (!$urlObj) {
             $urlObj = eZURL::create($href);
             $urlObj->store();
         }
         $linkNode->removeAttribute('href');
         $linkNode->setAttribute('url_id', $urlObj->attribute('id'));
         $urlObjectLink = eZURLObjectLink::create($urlObj->attribute('id'), $objectAttribute->attribute('id'), $objectAttribute->attribute('version'));
         $urlObjectLink->store();
     }
     foreach ($attributeNode->childNodes as $childNode) {
         if ($childNode->nodeType == XML_ELEMENT_NODE) {
             $xmlString = $childNode->ownerDocument->saveXML($childNode);
             $objectAttribute->setAttribute('data_text', $xmlString);
             break;
         }
     }
 }
开发者ID:nlescure,项目名称:ezpublish,代码行数:33,代码来源:ezxmltexttype.php


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