Swat/SwatActions.php
public function setViewSelector(
        SwatView $view,
        SwatViewSelector $selector = null
    ) {
        if ($view === null) {
            $selector = null;
        } else {
            if ($selector === null) {
                $selector = $view->getFirstDescendant('SwatViewSelector');
            }

            if ($selector === null) {
                throw new SwatException(
                    'No selector was specified and view does not have a ' .
                        'selector'
                );
            }
        }

        $this->view = $view;
        $this->selector = $selector;
    }
public function setViewSelector(
        SwatView $view,
        SwatViewSelector $selector = null
    ) {
        if ($view === null) {
            $selector = null;
        } else {
            if ($selector === null) {
                $selector = $view->getFirstDescendant('SwatViewSelector');
            }

            if ($selector === null) {
                throw new SwatException(
                    'No selector was specified and view does not have a ' .
                        'selector'
                );
            }
        }

        $this->view = $view;
        $this->selector = $selector;
    }
public function setViewSelector ( SwatView $ view , SwatViewSelector $ selector = null ) { if ( $ view === null ) { $ selector = null ; } else { if ( $ selector === null ) { $ selector = $ view -> getFirstDescendant ( 'SwatViewSelector' ) ; } if ( $ selector === null ) { throw new SwatException ( 'No selector was specified and view does not have a ' . 'selector' ) ; } } $ this -> view = $ view ; $ this -> selector = $ selector ; }
Sets the optional view and selector of this actions control

If a view and selector are specified for this actions control,
submitting the form is prevented until one or more items in the view
are selected by the selector.

@param SwatView $view the view items must be selected in. Specify null
to remove any existing view selector.
@param SwatViewSelector $selector optional. The selector in the view
that must select the items. If not
specified, the first selector in the
view is used.

@throws SwatException if no selector is specified and the the specified
view does not have a selector.
Sets the optional view and selector of this actions control