예제 #1
0
 /**
  * Constructor.
  *
  * @param FilterUtil_Config $config FilterUtil Configuration object.
  * @param array             $plgs   Plugins to load in form "plugin name => config array".
  */
 public function __construct(FilterUtil_Config $config, $plgs = null)
 {
     parent::__construct($config);
     if ($plgs !== null && is_array($plgs) && count($plgs) > 0) {
         $ok = $this->loadPlugins($plgs);
     }
     if ($ok == false) {
         return false;
     }
 }
예제 #2
0
 /**
  * Constructor.
  *
  * Argument $args may contain:
  *  plugins: Set of plugins to load.
  *  varname: Name of filters in $_REQUEST. Default: filter.
  *
  * @param string                $module Module name.
  * @param string|Doctrine_Table $table  Table name.
  * @param array                 $args   Mixed arguments.
  */
 public function __construct($module, $table, $args = array())
 {
     $this->setVarName('filter');
     $args['module'] = $module;
     $args['table'] = $table;
     parent::__construct(new FilterUtil_Config($args));
     $this->_plugin = new FilterUtil_PluginManager($this->getConfig(), array('default' => array()));
     if (isset($args['plugins'])) {
         $this->_plugin->loadPlugins($args['plugins']);
     }
     if (isset($args['restrictions'])) {
         $this->_plugin->loadRestrictions($args['restrictions']);
     }
     if (isset($args['varname'])) {
         $this->setVarName($args['varname']);
     }
     return $this;
 }
예제 #3
0
 /**
  * Constructor.
  *
  * @param array $config Array with the config key.
  */
 public function __construct($config)
 {
     parent::__construct($config['config']);
 }