/**
   * Constructor.
   *
   * @param array $options An array of options
   */
  public function __construct(array $options)
  {
    $options = array_merge(array(
      'query_methods'        => array('list' => null, 'object' => null),
      'connection'           => null,
    ), $options);

    parent::__construct($options);
  }
 public function __construct(array $options)
 {
     $this->options = array_merge(array('with_separated_confirm' => false), $this->options);
     parent::__construct($options);
     if (isset($this->options['with_separated_confirm']) && $this->options['with_separated_confirm']) {
         // with confirm
         $this->routes[$this->getRoute('cfnew')] = new $this->routeClass(sprintf('%s/confirm.:sf_format', $this->options['prefix_path']), array_merge($this->options['default_params'], array('module' => $this->options['module'], 'action' => $this->getActionMethod('confirm'), 'sf_format' => 'html')), array_merge($this->options['requirements'], array('sf_method' => 'post')), array('model' => $this->options['model'], 'type' => 'object'));
         $this->routes[$this->getRoute('cfedit')] = new $this->routeClass(sprintf('%s/confirm/:%s.:sf_format', $this->options['prefix_path'], $this->options['column']), array_merge($this->options['default_params'], array('module' => $this->options['module'], 'action' => $this->getActionMethod('confirm'), 'sf_format' => 'html')), array_merge($this->options['requirements'], array('sf_method' => 'post')), array('model' => $this->options['model'], 'type' => 'object', 'method' => $this->options['model_methods']['object']));
     }
 }
 /**
  * Constructor.
  *
  * @param array $options An array of options
  */
 public function __construct(array $options)
 {
     parent::__construct($options);
     if (!isset($this->options['model'])) {
         throw new InvalidArgumentException(sprintf('You must pass a "model" option to %s ("%s" route)', get_class($this), $this->options['name']));
     }
     $this->options = array_merge(array('actions' => false, 'module' => $this->options['name'], 'prefix_path' => '/' . $this->options['name'], 'column' => isset($this->options['column']) ? $this->options['column'] : 'id', 'model_methods' => array(), 'with_wildcard_routes' => false), $this->options);
     $this->options['requirements'] = array_merge(array($this->options['column'] => '\\d+'), $this->options['requirements']);
     $this->options['model_methods'] = array_merge(array('list' => null, 'object' => null), $this->options['model_methods']);
     if (isset($this->options['route_class'])) {
         $this->routeClass = $this->options['route_class'];
     }
     $this->generateRoutes();
 }
Ejemplo n.º 4
0
 /**
  * DOCUMENT ME
  * @param array $options
  */
 public function __construct(array $options)
 {
     // Prefix path is always empty since the engine page already brought us here
     $options['prefix_path'] = '';
     parent::__construct($options);
 }