contributions/querymodifiers/model/base/dbfiltergroupenum.cls.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * Convenience class for creating a filter on an enum value 00004 * 00005 * @ingroup QueryModifiers 00006 * @author Gerd Riesselmann 00007 */ 00008 class DBFilterGroupEnum extends DBFilterGroup { 00009 /** 00010 * Constructor 00011 * 00012 * @param string $fieldname Name of field 00013 * @param string $name Name of filter as shown to the user 00014 * @param array $enums Associative array of enum values with DBValue as key, and dispaly value as value 00015 * @param string $default Optional default value 00016 */ 00017 public function __construct($fieldname, $name, $enums, $default = '') { 00018 $columns = array(); 00019 foreach($enums as $ekey => $evalue) { 00020 $columns[String::plain_ascii($ekey)] = new DBFilterColumn( 00021 $fieldname, 00022 $ekey, 00023 $evalue 00024 ); 00025 } 00026 parent::__construct($fieldname, $name, $columns, String::plain_ascii($default)); 00027 } 00028 }