src/Security/Group.php
public function collateFamilyIDs()
    {
        if (!$this->exists()) {
            throw new \InvalidArgumentException("Cannot call collateFamilyIDs on unsaved Group.");
        }

        $familyIDs = array();
        $chunkToAdd = array($this->ID);

        while ($chunkToAdd) {
            $familyIDs = array_merge($familyIDs, $chunkToAdd);

            // Get the children of *all* the groups identified in the previous chunk.
            // This minimises the number of SQL queries necessary
            $chunkToAdd = Group::get()->filter("ParentID", $chunkToAdd)->column('ID');
        }

        return $familyIDs;
    }
public function collateFamilyIDs()
    {
        if (!$this->exists()) {
            throw new \InvalidArgumentException("Cannot call collateFamilyIDs on unsaved Group.");
        }

        $familyIDs = array();
        $chunkToAdd = array($this->ID);

        while ($chunkToAdd) {
            $familyIDs = array_merge($familyIDs, $chunkToAdd);

            // Get the children of *all* the groups identified in the previous chunk.
            // This minimises the number of SQL queries necessary
            $chunkToAdd = Group::get()->filter("ParentID", $chunkToAdd)->column('ID');
        }

        return $familyIDs;
    }
public function collateFamilyIDs ( ) { if ( ! $ this -> exists ( ) ) { throw new \ InvalidArgumentException ( "Cannot call collateFamilyIDs on unsaved Group." ) ; } $ familyIDs = array ( ) ; $ chunkToAdd = array ( $ this -> ID ) ; while ( $ chunkToAdd ) { $ familyIDs = array_merge ( $ familyIDs , $ chunkToAdd ) ; // Get the children of *all* the groups identified in the previous chunk. // This minimises the number of SQL queries necessary $ chunkToAdd = Group :: get ( ) -> filter ( "ParentID" , $ chunkToAdd ) -> column ( 'ID' ) ; } return $ familyIDs ; }
Return a set of this record's "family" of IDs - the IDs of
this record and all its descendants.

@return array
Return a set of this record s family of IDs - the IDs of this record and all its descendants .