protected function add_result($result) {
        if (is_array($result)) {
            // Adding the result to the oldest parent.
            if ($this->get_parent()) {
                $parent = $this->get_grandparent();
                $parent->add_result($result);
            } else {
                $this->results = array_merge($this->results, $result);
            }
        }
    }