本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}