public function hasDescendant(TaskConfiguration $taskConfig, $checkErrors = true)
    {
        foreach ($this->getNextTasksConfigurations() as $nextTaskConfig) {
            // Avoid errors for direct descendant
            if ($this->getCode() === $nextTaskConfig->getCode()) {
                continue;
            }

            if ($nextTaskConfig->getCode() === $taskConfig->getCode()) {
                return true;
            }

            if ($nextTaskConfig->hasDescendant($taskConfig, $checkErrors)) {
                return true;
            }
        }

        if ($checkErrors) {
            foreach ($this->getErrorTasksConfigurations() as $errorTasksConfig) {
                // Avoid errors for direct error descendant
                if ($this->getCode() === $errorTasksConfig->getCode()) {
                    continue;
                }

                if ($errorTasksConfig->getCode() === $taskConfig->getCode()) {
                    return true;
                }

                if ($errorTasksConfig->hasDescendant($taskConfig, $checkErrors)) {
                    return true;
                }
            }
        }

        return false;
    }
public function hasDescendant(TaskConfiguration $taskConfig, $checkErrors = true)
    {
        foreach ($this->getNextTasksConfigurations() as $nextTaskConfig) {
            // Avoid errors for direct descendant
            if ($this->getCode() === $nextTaskConfig->getCode()) {
                continue;
            }

            if ($nextTaskConfig->getCode() === $taskConfig->getCode()) {
                return true;
            }

            if ($nextTaskConfig->hasDescendant($taskConfig, $checkErrors)) {
                return true;
            }
        }

        if ($checkErrors) {
            foreach ($this->getErrorTasksConfigurations() as $errorTasksConfig) {
                // Avoid errors for direct error descendant
                if ($this->getCode() === $errorTasksConfig->getCode()) {
                    continue;
                }

                if ($errorTasksConfig->getCode() === $taskConfig->getCode()) {
                    return true;
                }

                if ($errorTasksConfig->hasDescendant($taskConfig, $checkErrors)) {
                    return true;
                }
            }
        }

        return false;
    }
public function hasDescendant ( TaskConfiguration $ taskConfig , $ checkErrors = true ) { foreach ( $ this -> getNextTasksConfigurations ( ) as $ nextTaskConfig ) { // Avoid errors for direct descendant if ( $ this -> getCode ( ) === $ nextTaskConfig -> getCode ( ) ) { continue ; } if ( $ nextTaskConfig -> getCode ( ) === $ taskConfig -> getCode ( ) ) { return true ; } if ( $ nextTaskConfig -> hasDescendant ( $ taskConfig , $ checkErrors ) ) { return true ; } } if ( $ checkErrors ) { foreach ( $ this -> getErrorTasksConfigurations ( ) as $ errorTasksConfig ) { // Avoid errors for direct error descendant if ( $ this -> getCode ( ) === $ errorTasksConfig -> getCode ( ) ) { continue ; } if ( $ errorTasksConfig -> getCode ( ) === $ taskConfig -> getCode ( ) ) { return true ; } if ( $ errorTasksConfig -> hasDescendant ( $ taskConfig , $ checkErrors ) ) { return true ; } } } return false ; }
Check task ancestors to find if it have a given task as child

@param TaskConfiguration $taskConfig
@param bool              $checkErrors

@return bool
Check task ancestors to find if it have a given task as child