360kdw /plugins/vjCommentPlugin/lib/filter/doctrine/PluginCommentFormFilter.class.php

Language PHP Lines 29
MD5 Hash e840e61b5d6540d72e0692d81b601ac4 Estimated Cost $352 (why?)
Repository https://bitbucket.org/Kudlaty/360kdw.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

/**
 * PluginComment form.
 *
 * @package    vjCommentPlugin
 * @subpackage filter
 * @author     Jean-Philippe MORVAN <jp.morvan@ville-villejuif.fr>
 * @version    SVN: $Id: sfDoctrineFormFilterPluginTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
abstract class PluginCommentFormFilter extends BaseCommentFormFilter
{
  public function setup()
  {
    parent::setup();
    $this->widgetSchema['record_model'] = new sfWidgetFormDoctrineChoice(array('model' => 'Comment', 'key_method' => 'getRecordModel', 'method' => 'getRecordModel', 'add_empty' => true));
    $this->validatorSchema['record_model'] = new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'Comment', 'column' => 'record_model'));
  }

  public function addRecordModelColumnQuery($query, $field, $value)
  {
    if (!empty($value))
    {
      $query->addWhere('record_model=?', $value);
    }
  }

}
Back to Top