Swat/SwatWidgetCellRenderer.php
public function getWidgets($widget_id = null)
    {
        $form = $this->getForm();
        if ($form !== null && $form->isSubmitted()) {
            $replicators = $form->getHiddenField(
                $this->getReplicatorFieldName()
            );

            $widgets = array();
            if (is_array($replicators)) {
                foreach ($this->clones as $replicator_id => $clone) {
                    if (in_array($replicator_id, $replicators)) {
                        if (
                            $widget_id !== null &&
                            !isset($this->widgets[$replicator_id][$widget_id])
                        ) {
                            throw new SwatWidgetNotFoundException(
                                sprintf(
                                    'No widget with the id "%s" exists in the ' .
                                        'cloned widget sub-tree of this ' .
                                        'SwatWidgetCellRenderer.',
                                    $widget_id
                                ),
                                0,
                                $widget_id
                            );
                        }

                        $widgets[$replicator_id] = $this->getWidget(
                            $replicator_id,
                            $widget_id
                        );
                    }
                }
            }
        } else {
            $widgets = $this->clones;
        }

        return $widgets;
    }
public function getWidgets($widget_id = null)
    {
        $form = $this->getForm();
        if ($form !== null && $form->isSubmitted()) {
            $replicators = $form->getHiddenField(
                $this->getReplicatorFieldName()
            );

            $widgets = array();
            if (is_array($replicators)) {
                foreach ($this->clones as $replicator_id => $clone) {
                    if (in_array($replicator_id, $replicators)) {
                        if (
                            $widget_id !== null &&
                            !isset($this->widgets[$replicator_id][$widget_id])
                        ) {
                            throw new SwatWidgetNotFoundException(
                                sprintf(
                                    'No widget with the id "%s" exists in the ' .
                                        'cloned widget sub-tree of this ' .
                                        'SwatWidgetCellRenderer.',
                                    $widget_id
                                ),
                                0,
                                $widget_id
                            );
                        }

                        $widgets[$replicator_id] = $this->getWidget(
                            $replicator_id,
                            $widget_id
                        );
                    }
                }
            }
        } else {
            $widgets = $this->clones;
        }

        return $widgets;
    }
public function getWidgets ( $ widget_id = null ) { $ form = $ this -> getForm ( ) ; if ( $ form !== null && $ form -> isSubmitted ( ) ) { $ replicators = $ form -> getHiddenField ( $ this -> getReplicatorFieldName ( ) ) ; $ widgets = array ( ) ; if ( is_array ( $ replicators ) ) { foreach ( $ this -> clones as $ replicator_id => $ clone ) { if ( in_array ( $ replicator_id , $ replicators ) ) { if ( $ widget_id !== null && ! isset ( $ this -> widgets [ $ replicator_id ] [ $ widget_id ] ) ) { throw new SwatWidgetNotFoundException ( sprintf ( 'No widget with the id "%s" exists in the ' . 'cloned widget sub-tree of this ' . 'SwatWidgetCellRenderer.' , $ widget_id ) , 0 , $ widget_id ) ; } $ widgets [ $ replicator_id ] = $ this -> getWidget ( $ replicator_id , $ widget_id ) ; } } } } else { $ widgets = $ this -> clones ; } return $ widgets ; }
Gets an array of replicated widgets indexed by the replicator_id

If this cell renderer's form is submitted, only cloned widgets that were
displayed and processed are returned.

@param string $widget_id the unique id of the original widget, or null
to get the root

@return array an array of widgets indexed by replicator_id

@throws SwatWidgetNotFoundException if a widget id is specified and no
such widget exists in the subtree.
Gets an array of replicated widgets indexed by the replicator_id