public function getUsage()
    {
        $usage = new ArrayList();

        if ($page = $this->getPage()) {
            $usage->push($page);
            if ($this->virtualOwner) {
                $page->setField('ElementType', 'Linked');
            } else {
                $page->setField('ElementType', 'Master');
            }
        }

        $linkedElements = ElementVirtual::get()->filter('LinkedElementID', $this->ID);

        foreach ($linkedElements as $element) {
            $area = $element->Parent();

            if ($area instanceof ElementalArea && $page = $area->getOwnerPage()) {
                $page->setField('ElementType', 'Linked');
                $usage->push($page);
            }
        }

        $usage->removeDuplicates();
        return $usage;
    }
public function getUsage()
    {
        $usage = new ArrayList();

        if ($page = $this->getPage()) {
            $usage->push($page);
            if ($this->virtualOwner) {
                $page->setField('ElementType', 'Linked');
            } else {
                $page->setField('ElementType', 'Master');
            }
        }

        $linkedElements = ElementVirtual::get()->filter('LinkedElementID', $this->ID);

        foreach ($linkedElements as $element) {
            $area = $element->Parent();

            if ($area instanceof ElementalArea && $page = $area->getOwnerPage()) {
                $page->setField('ElementType', 'Linked');
                $usage->push($page);
            }
        }

        $usage->removeDuplicates();
        return $usage;
    }
public function getUsage ( ) { $ usage = new ArrayList ( ) ; if ( $ page = $ this -> getPage ( ) ) { $ usage -> push ( $ page ) ; if ( $ this -> virtualOwner ) { $ page -> setField ( 'ElementType' , 'Linked' ) ; } else { $ page -> setField ( 'ElementType' , 'Master' ) ; } } $ linkedElements = ElementVirtual :: get ( ) -> filter ( 'LinkedElementID' , $ this -> ID ) ; foreach ( $ linkedElements as $ element ) { $ area = $ element -> Parent ( ) ; if ( $ area instanceof ElementalArea && $ page = $ area -> getOwnerPage ( ) ) { $ page -> setField ( 'ElementType' , 'Linked' ) ; $ usage -> push ( $ page ) ; } } $ usage -> removeDuplicates ( ) ; return $ usage ; }
get all pages where this element is used

@return ArrayList
get all pages where this element is used