/**
  * Constructor.
  *
  * Available options:
  *
  *  * model:        The model class (required)
  *  * method:       The method to use to display object values (__toString by default)
  *  * key_method:   The method to use to display the object keys (getPrimaryKey by default)
  *  * order_by:     An array composed of two fields:
  *                    * The column to order by the results (must be in the PhpName format)
  *                    * asc or desc
  *  * query:        A query to use when retrieving objects
  *  * table_method: A method to return either a query, collection or single object
  */
 protected function configure($options = array(), $attributes = array())
 {
     $this->addRequiredOption('model');
     $this->addOption('method', '__toString');
     $this->addOption('key_method', 'getPrimaryKey');
     $this->addOption('order_by', null);
     $this->addOption('query', null);
     $this->addOption('table_method', null);
     parent::configure($options, $attributes);
 }
コード例 #2
0
 protected function configure($options = array(), $attributes = array())
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers(array('Asset', 'Tag', 'I18N'));
     parent::configure($options, $attributes);
     $this->addOption('class_select', 'ancho');
     $this->addOption('label_unassociated', __('Unassociated'));
     $this->addOption('label_associated', __('Associated'));
     $this->addOption('associate', image_tag('/sfFormExtraPlugin/images/next.png'));
     $this->addOption('unassociate', image_tag('/sfFormExtraPlugin/images/previous.png'));
 }
コード例 #3
0
 /**
  * Constructor.
  *
  * Available options:
  *
  *  * model:       The model class (required)
  *                 If the option is not a Boolean, the value will be used as the text value
  *  * column:      The column wich is serached
  *  * method:      The method to use to display object values (__toString by default)
  *  * key_method:  The method to use to display the object keys (getPrimaryKey by default) 
  *  * order_by:    An array composed of two fields:
  *                   * The column to order by the results (must be in the PhpName format)
  *                   * asc or desc
  *  * criteria:    A criteria to use when retrieving objects
  *  * connection:  The Propel connection to use (null by default)
  *  * peer_method: The peer method to use to fetch objects
  *
  */
 protected function configure($options = array(), $attributes = array())
 {
     sfContext::getInstance()->getConfiguration()->loadHelpers(array('Url', 'I18N'));
     parent::configure($options, $attributes);
     $this->addRequiredOption('column');
     $this->addRequiredOption('model');
     $this->addOption('method', '__toString');
     $this->addOption('key_method', 'getPrimaryKey');
     $this->addOption('order_by', null);
     $this->addOption('criteria', null);
     $this->addOption('connection', null);
     $this->addOption('peer_method', 'doSelect');
     $this->addOption('custom_handler', false);
     $this->addOption('loader', 'Please wait...');
 }