PageRenderTime 203ms CodeModel.GetById 101ms app.highlight 2ms RepoModel.GetById 99ms app.codeStats 0ms

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

https://bitbucket.org/Kudlaty/360kdw
PHP | 28 lines | 17 code | 3 blank | 8 comment | 1 complexity | e840e61b5d6540d72e0692d81b601ac4 MD5 | raw file
 1<?php
 2
 3/**
 4 * PluginComment form.
 5 *
 6 * @package    vjCommentPlugin
 7 * @subpackage filter
 8 * @author     Jean-Philippe MORVAN <jp.morvan@ville-villejuif.fr>
 9 * @version    SVN: $Id: sfDoctrineFormFilterPluginTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
10 */
11abstract class PluginCommentFormFilter extends BaseCommentFormFilter
12{
13  public function setup()
14  {
15    parent::setup();
16    $this->widgetSchema['record_model'] = new sfWidgetFormDoctrineChoice(array('model' => 'Comment', 'key_method' => 'getRecordModel', 'method' => 'getRecordModel', 'add_empty' => true));
17    $this->validatorSchema['record_model'] = new sfValidatorDoctrineChoice(array('required' => false, 'model' => 'Comment', 'column' => 'record_model'));
18  }
19
20  public function addRecordModelColumnQuery($query, $field, $value)
21  {
22    if (!empty($value))
23    {
24      $query->addWhere('record_model=?', $value);
25    }
26  }
27
28}