Pimcore\Model\Element\Service::getType PHP Метод

getType() публичный статический Метод

determines the type of an element (object,asset,document)
public static getType ( Pimcore\Model\Element\ElementInterface $element ) : string
$element Pimcore\Model\Element\ElementInterface
Результат string
    public static function getType($element)
    {
        return self::getElementType($element);
    }

Usage Example

Пример #1
0
 public function extractRelations($element, $apiElementKeys, $recursive, $includeRelations)
 {
     $foundRelations = [];
     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()] = ["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()] = ["elementType" => Element\Service::getType($child), "element" => $child->getId(), "recursive" => $recursive];
             }
         }
     }
     return $foundRelations;
 }
All Usage Examples Of Pimcore\Model\Element\Service::getType