当前位置: 首页>>代码示例>>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;未经允许,请勿转载。