public function process($processor) {
        if (!$processor instanceof base_processor) { // No correct processor, throw exception
            throw new base_element_struct_exception('incorrect_processor');
        }

        $iterator = $this->get_iterator($processor); // Get the iterator over backup-able data

        $itcounter = 0; // To check that the iterator only has 1 ocurrence
        foreach ($iterator as $key => $values) { // Process each "ocurrrence" of the nested element (recordset or array)

            // Fill the values of the attributes and final elements with the $values from the iterator
            $this->fill_values($values);

            // Delegate the process of each final_element
            foreach ($this->get_final_elements() as $final_element) {
                $final_element->process($processor);
            }

            // Everything processed, clean values before next iteration
            $this->clean_values();

            // Increment counters for this element
            $this->counter++;
            $itcounter++;

            // optigroup_element, check we only have 1 element always
            if ($itcounter > 1) {
                throw new base_element_struct_exception('optigroup_element_only_one_ocurrence', $this->get_name());
            }
        }
        // Close the iterator (DB recordset / array iterator)
        $iterator->close();
    }
public function process($processor) {
        if (!$processor instanceof base_processor) { // No correct processor, throw exception
            throw new base_element_struct_exception('incorrect_processor');
        }

        $iterator = $this->get_iterator($processor); // Get the iterator over backup-able data

        $itcounter = 0; // To check that the iterator only has 1 ocurrence
        foreach ($iterator as $key => $values) { // Process each "ocurrrence" of the nested element (recordset or array)

            // Fill the values of the attributes and final elements with the $values from the iterator
            $this->fill_values($values);

            // Delegate the process of each final_element
            foreach ($this->get_final_elements() as $final_element) {
                $final_element->process($processor);
            }

            // Everything processed, clean values before next iteration
            $this->clean_values();

            // Increment counters for this element
            $this->counter++;
            $itcounter++;

            // optigroup_element, check we only have 1 element always
            if ($itcounter > 1) {
                throw new base_element_struct_exception('optigroup_element_only_one_ocurrence', $this->get_name());
            }
        }
        // Close the iterator (DB recordset / array iterator)
        $iterator->close();
    }
public function process ( $ processor ) { if ( ! $ processor instanceof base_processor ) { // No correct processor, throw exception throw new base_element_struct_exception ( 'incorrect_processor' ) ; } $ iterator = $ this -> get_iterator ( $ processor ) ; // Get the iterator over backup-able data $ itcounter = 0 ; // To check that the iterator only has 1 ocurrence foreach ( $ iterator as $ key => $ values ) { // Process each "ocurrrence" of the nested element (recordset or array) // Fill the values of the attributes and final elements with the $values from the iterator $ this -> fill_values ( $ values ) ; // Delegate the process of each final_element foreach ( $ this -> get_final_elements ( ) as $ final_element ) { $ final_element -> process ( $ processor ) ; } // Everything processed, clean values before next iteration $ this -> clean_values ( ) ; // Increment counters for this element $ this -> counter ++ ; $ itcounter ++ ; // optigroup_element, check we only have 1 element always if ( $ itcounter > 1 ) { throw new base_element_struct_exception ( 'optigroup_element_only_one_ocurrence' , $ this -> get_name ( ) ) ; } } // Close the iterator (DB recordset / array iterator) $ iterator -> close ( ) ; }
process one optigroup_element

Note that this ONLY processes the final elements in order to get all them
before processing any nested element. Pending nested elements are processed
by the optigroup caller.
process one optigroup_element