public function action($mode, $args = [])
    {
        if (!$this->persistence) {
            throw new Exception(['action() requires model to be associated with db']);
        }

        if (!$this->persistence->hasMethod('action')) {
            throw new Exception('Persistence does not support action()');
        }

        return $this->persistence->action($this, $mode, $args);
    }
public function action($mode, $args = [])
    {
        if (!$this->persistence) {
            throw new Exception(['action() requires model to be associated with db']);
        }

        if (!$this->persistence->hasMethod('action')) {
            throw new Exception('Persistence does not support action()');
        }

        return $this->persistence->action($this, $mode, $args);
    }
public function action ( $ mode , $ args = [ ] ) { if ( ! $ this -> persistence ) { throw new Exception ( [ 'action() requires model to be associated with db' ] ) ; } if ( ! $ this -> persistence -> hasMethod ( 'action' ) ) { throw new Exception ( 'Persistence does not support action()' ) ; } return $ this -> persistence -> action ( $ this , $ mode , $ args ) ; }
Execute action.

@param string $mode
@param array  $args

@throws Exception

@return \atk4\dsql\Query
Execute action .