public function BackLinkTracking()
    {
        // @todo - Implement PolymorphicManyManyList to replace this
        $list = ArrayList::create();

        $siteTreelinkTable = SiteTreeLink::singleton()->baseTable();

        // Get the list of back links classes
        $parentClasses = $this->BackLinks()->exclude(['ParentClass' => null])->columnUnique('ParentClass');

        // Get list of sitreTreelink and join them to the their parent class to make sure we don't get orphan records.
        foreach ($parentClasses as $parentClass) {
            $joinClause = sprintf(
                "\"%s\".\"ParentID\"=\"%s\".\"ID\"",
                $siteTreelinkTable,
                DataObject::singleton($parentClass)->baseTable()
            );

            $links = DataObject::get($parentClass)
                ->innerJoin(
                    $siteTreelinkTable,
                    $joinClause
                )
                ->where([
                    "\"$siteTreelinkTable\".\"LinkedID\"" => $this->ID,
                    "\"$siteTreelinkTable\".\"ParentClass\"" => $parentClass,
                ])
                ->alterDataQuery(function ($query) {
                    $query->selectField("'Content link'", "DependentLinkType");
                });
            $list->merge($links);
        }

        return $list;
    }
public function BackLinkTracking()
    {
        // @todo - Implement PolymorphicManyManyList to replace this
        $list = ArrayList::create();

        $siteTreelinkTable = SiteTreeLink::singleton()->baseTable();

        // Get the list of back links classes
        $parentClasses = $this->BackLinks()->exclude(['ParentClass' => null])->columnUnique('ParentClass');

        // Get list of sitreTreelink and join them to the their parent class to make sure we don't get orphan records.
        foreach ($parentClasses as $parentClass) {
            $joinClause = sprintf(
                "\"%s\".\"ParentID\"=\"%s\".\"ID\"",
                $siteTreelinkTable,
                DataObject::singleton($parentClass)->baseTable()
            );

            $links = DataObject::get($parentClass)
                ->innerJoin(
                    $siteTreelinkTable,
                    $joinClause
                )
                ->where([
                    "\"$siteTreelinkTable\".\"LinkedID\"" => $this->ID,
                    "\"$siteTreelinkTable\".\"ParentClass\"" => $parentClass,
                ])
                ->alterDataQuery(function ($query) {
                    $query->selectField("'Content link'", "DependentLinkType");
                });
            $list->merge($links);
        }

        return $list;
    }
public function BackLinkTracking ( ) { // @todo - Implement PolymorphicManyManyList to replace this $ list = ArrayList :: create ( ) ; $ siteTreelinkTable = SiteTreeLink :: singleton ( ) -> baseTable ( ) ; // Get the list of back links classes $ parentClasses = $ this -> BackLinks ( ) -> exclude ( [ 'ParentClass' => null ] ) -> columnUnique ( 'ParentClass' ) ; // Get list of sitreTreelink and join them to the their parent class to make sure we don't get orphan records. foreach ( $ parentClasses as $ parentClass ) { $ joinClause = sprintf ( "\"%s\".\"ParentID\"=\"%s\".\"ID\"" , $ siteTreelinkTable , DataObject :: singleton ( $ parentClass ) -> baseTable ( ) ) ; $ links = DataObject :: get ( $ parentClass ) -> innerJoin ( $ siteTreelinkTable , $ joinClause ) -> where ( [ "\"$siteTreelinkTable\".\"LinkedID\"" => $ this -> ID , "\"$siteTreelinkTable\".\"ParentClass\"" => $ parentClass , ] ) -> alterDataQuery ( function ( $ query ) { $ query -> selectField ( "'Content link'" , "DependentLinkType" ) ; } ) ; $ list -> merge ( $ links ) ; } return $ list ; }
Get the back-link tracking objects that link to this page

@return ArrayList|DataObject[]
Get the back - link tracking objects that link to this page