本文整理汇总了PHP中Pimcore\Model\Element\Service::getDependedElement方法的典型用法代码示例。如果您正苦于以下问题:PHP Service::getDependedElement方法的具体用法?PHP Service::getDependedElement怎么用?PHP Service::getDependedElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pimcore\Model\Element\Service
的用法示例。
在下文中一共展示了Service::getDependedElement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: extractRelations
public function extractRelations($element, $apiElementKeys, $recursive, $includeRelations)
{
$foundRelations = array();
if ($includeRelations) {
$dependency = $element->getDependencies();
if ($dependency) {
foreach ($dependency->getRequires() as $r) {
if ($e = Element\Service::getDependedElement($r)) {
if ($element->getId() != $e->getId() and !in_array(Element\Service::getElementType($e) . "_" . $e->getId(), $apiElementKeys)) {
$foundRelations[Element\Service::getElementType($e) . "_" . $e->getId()] = array("elementType" => Element\Service::getType($e), "element" => $e->getId(), "recursive" => false);
}
}
}
}
}
$childs = $element->getChilds();
if ($recursive and $childs) {
foreach ($childs as $child) {
if (!in_array(Element\Service::getType($child) . "_" . $child->getId(), $apiElementKeys)) {
$foundRelations[Element\Service::getType($child) . "_" . $child->getId()] = array("elementType" => Element\Service::getType($child), "element" => $child->getId(), "recursive" => $recursive);
}
}
}
return $foundRelations;
}