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


PHP Service::correctPath方法代碼示例

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


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

示例1: pathExists

 /**
  * @static
  * @param $path
  * @return bool
  */
 public static function pathExists($path, $type = null)
 {
     $path = Element\Service::correctPath($path);
     try {
         $object = new AbstractObject();
         if (\Pimcore\Tool::isValidPath($path)) {
             $object->getDao()->getByPath($path);
             return true;
         }
     } catch (\Exception $e) {
     }
     return false;
 }
開發者ID:elavarasann,項目名稱:pimcore,代碼行數:18,代碼來源:Service.php

示例2: getByPath

 /**
  * @param string $path
  * @return self
  */
 public static function getByPath($path)
 {
     $path = Model\Element\Service::correctPath($path);
     try {
         $object = new self();
         if (Tool::isValidPath($path)) {
             $object->getResource()->getByPath($path);
             return self::getById($object->getId());
         }
     } catch (\Exception $e) {
         \Logger::warning($e->getMessage());
     }
     return null;
 }
開發者ID:rolandstoll,項目名稱:pimcore,代碼行數:18,代碼來源:AbstractObject.php

示例3: getByPath

 /**
  * Static helper to get an asset by the passed path (returned is not the concrete asset like Asset\Folder!)
  *
  * @param string $path
  * @return Asset
  */
 public static function getByPath($path)
 {
     $path = Element\Service::correctPath($path);
     try {
         $asset = new Asset();
         if (Tool::isValidPath($path)) {
             $asset->getDao()->getByPath($path);
             return self::getById($asset->getId());
         }
     } catch (\Exception $e) {
         \Logger::warning($e->getMessage());
     }
     return null;
 }
開發者ID:solverat,項目名稱:pimcore,代碼行數:20,代碼來源:Asset.php

示例4: getByPath

 /**
  * Static helper to get a Document by it's path, only type Document is returned, not Document\Page, ... (see getConcreteByPath() )
  *
  * @param string $path
  * @return Document
  */
 public static function getByPath($path)
 {
     $path = Element\Service::correctPath($path);
     try {
         $document = new Document();
         // validate path
         if (Tool::isValidPath($path)) {
             $document->getResource()->getByPath($path);
         }
         return self::getById($document->getId());
     } catch (\Exception $e) {
         \Logger::debug($e->getMessage());
     }
     return null;
 }
開發者ID:yonetici,項目名稱:pimcore-coreshop-demo,代碼行數:21,代碼來源:Document.php

示例5: pathExists

 /**
  * @static
  * @param $path
  * @return bool
  */
 public static function pathExists($path, $type = null)
 {
     $path = Element\Service::correctPath($path);
     try {
         $document = new Document();
         // validate path
         if (\Pimcore\Tool::isValidPath($path)) {
             $document->getResource()->getByPath($path);
             return true;
         }
     } catch (\Exception $e) {
     }
     return false;
 }
開發者ID:Gerhard13,項目名稱:pimcore,代碼行數:19,代碼來源:Service.php


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