本文整理汇总了PHP中Pimcore\Model\Object\Concrete::getLatestVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP Concrete::getLatestVersion方法的具体用法?PHP Concrete::getLatestVersion怎么用?PHP Concrete::getLatestVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pimcore\Model\Object\Concrete
的用法示例。
在下文中一共展示了Concrete::getLatestVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLatestVersion
/**
* @param Object\Concrete $object
* @return Object\Concrete
*/
protected function getLatestVersion(Object\Concrete $object)
{
$modificationDate = $object->getModificationDate();
$latestVersion = $object->getLatestVersion();
if ($latestVersion) {
$latestObj = $latestVersion->loadData();
if ($latestObj instanceof Object\Concrete) {
$object = $latestObj;
$object->setModificationDate($modificationDate);
// set de modification-date from published version to compare it in js-frontend
}
}
return $object;
}
示例2: getLatestVersion
/**
* @param Document|Asset|ConcreteObject $element
* @return Document|Asset|ConcreteObject
*/
protected function getLatestVersion($element)
{
//TODO move this maybe to a service method, since this is also used in ObjectController and DocumentControllers
if ($element instanceof Document) {
$latestVersion = $element->getLatestVersion();
if ($latestVersion) {
$latestDoc = $latestVersion->loadData();
if ($latestDoc instanceof Document) {
$element = $latestDoc;
$element->setModificationDate($element->getModificationDate());
}
}
}
if ($element instanceof Object\Concrete) {
$modificationDate = $element->getModificationDate();
$latestVersion = $element->getLatestVersion();
if ($latestVersion) {
$latestObj = $latestVersion->loadData();
if ($latestObj instanceof ConcreteObject) {
$element = $latestObj;
$element->setModificationDate($modificationDate);
}
}
}
return $element;
}