00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 class DBFilterOnLinkedTable extends DBFilter {
00031
00032
00033
00034
00035
00036 protected $filter;
00037
00038
00039
00040
00041
00042
00043 protected $linked_table;
00044
00045
00046
00047
00048
00049
00050 protected $join_conditions;
00051
00052
00053
00054
00055
00056
00057 protected $join_type;
00058
00059 public function __construct($title, $filter, $table, $join_condition = false, $join_type = DBQueryJoined::INNER) {
00060 $this->filter = $filter;
00061 $this->linked_table = $table;
00062 $this->join_condition = $join_condition;
00063 $this->join_type = $join_type;
00064 parent::__construct($title);
00065 }
00066
00067
00068
00069
00070
00071
00072
00073 public function apply($query) {
00074 $table = ($this->linked_table instanceof IDBTable) ? $this->linked_table : DB::create($this->linked_table);
00075 $this->filter->apply($table);
00076 $query->join($table, $this->join_conditions, $this->join_type);
00077 }
00078
00079
00080
00081
00082
00083
00084 public function get_inside_filter() {
00085 return $this->filter;
00086 }
00087 }