00001 <?php
00002 Load::tools('filtertext');
00003
00004
00005
00006
00007
00008
00009
00010 class FilterUsername extends FilterText {
00011
00012
00013
00014
00015
00016 public function __construct($page_data, $adapter = false) {
00017 $this->adapter = ($adapter instanceof IFilterTextAdapter) ? $adapter : new FilterTextDefaultAdapter($page_data, 'username');
00018 $this->page_data = $page_data;
00019 $this->filter_object = new DBFilterMultiColumn(
00020 array(
00021 new DBFilterMultiColumnItem('name', $this->adapter->get_value(), DBWhere::OP_LIKE, DBWhere::LOGIC_OR),
00022 new DBFilterMultiColumnItem('email', $this->adapter->get_value(), DBWhere::OP_LIKE, DBWhere::LOGIC_OR),
00023 ),
00024 tr('name')
00025 );
00026 }
00027
00028
00029
00030
00031
00032
00033 public function get_filter_value() {
00034 $items = $this->filter_object->get_items();
00035 return $items[0]->value;
00036 }
00037 }