private static function checkRecursion($component, $sections)
    {
        $sectparent = null;

        foreach ($sections as $key => $sect) {

            if (in_array($component, $sect->getSectionParts()->getArrayCopy())) {

                $sectparent = $sect;
            }

            if ($sect->getIdentifier() == $component->getIdentifier()) {
                break;
            }
        }

        return $sectparent;
    }
private static function checkRecursion($component, $sections)
    {
        $sectparent = null;

        foreach ($sections as $key => $sect) {

            if (in_array($component, $sect->getSectionParts()->getArrayCopy())) {

                $sectparent = $sect;
            }

            if ($sect->getIdentifier() == $component->getIdentifier()) {
                break;
            }
        }

        return $sectparent;
    }
private static function checkRecursion ( $ component , $ sections ) { $ sectparent = null ; foreach ( $ sections as $ key => $ sect ) { if ( in_array ( $ component , $ sect -> getSectionParts ( ) -> getArrayCopy ( ) ) ) { $ sectparent = $ sect ; } if ( $ sect -> getIdentifier ( ) == $ component -> getIdentifier ( ) ) { break ; } } return $ sectparent ; }
Checks if the current section has a parent, and returns it, if any.

Gets the list of sections of this AssessmentTest, and checks if any has the AssessmentSection
set as parameter in its components. If some has, we keep the last section found (to take the
closest parent).

@param $component AssessmentSection The section from which we want to find the parent.
@param $sections AssessmentSectionCollection The collection of all sections in this AssessmentTest.
@return AssessmentSection|null The parent of the AssessmentSection set as parameter, if any.
Checks if the current section has a parent and returns it if any .