.

DBFilterOnLinkedTable Class Reference
[QueryModifiers]

Execute a given filter on a linked table, rather than the primary table. More...

Inheritance diagram for DBFilterOnLinkedTable:
DBFilter IDBQueryModifier

List of all members.

Public Member Functions

  __construct ($title, $filter, $table, $join_condition=false, $join_type=DBQueryJoined::INNER)
  apply ($query)
  Apply.
  get_inside_filter ()
  Returns inside filter.

Protected Attributes

  $filter
  $join_conditions
  $join_type
  $linked_table

Detailed Description

Execute a given filter on a linked table, rather than the primary table.

Construct with another filter to execute

 public function get_filters() {
   return array(
     new DBFilterGroup(
       'filteronlink',
       tr('Filtering on linked table'),
       array(
         'example' => new DBFilterOnLinkedTable(
           tr('Example'),
           new DBFilterColumn('field_a', 'value_a', 'Ignored'),
           'table_linked'
         ), 
         // Filters can be mixed!
         'classic' => new DBFilterColumn('field_c', 'old_stuff', tr('Classic'))
       )
     );
   )
 }
Author:
Gerd Riesselmann

Definition at line 30 of file dbfilteronlinkedtable.cls.php.


Constructor & Destructor Documentation

DBFilterOnLinkedTable::__construct ( title,
filter,
table,
join_condition = false,
join_type = DBQueryJoined::INNER  
)

Definition at line 59 of file dbfilteronlinkedtable.cls.php.

00059                                                                                                                        {
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         }

Member Function Documentation

DBFilterOnLinkedTable::apply ( query  ) 

Apply.

Parameters:
DataObjectBase  $query

Reimplemented from DBFilter.

Definition at line 73 of file dbfilteronlinkedtable.cls.php.

00073                                       {
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         }       
DBFilterOnLinkedTable::get_inside_filter (  ) 

Returns inside filter.

Returns:
DBFilter

Definition at line 84 of file dbfilteronlinkedtable.cls.php.

00084                                             {
00085                 return $this->filter;
00086         }

Member Data Documentation

DBFilterOnLinkedTable::$filter [protected]

Definition at line 36 of file dbfilteronlinkedtable.cls.php.

DBFilterOnLinkedTable::$join_conditions [protected]

Definition at line 50 of file dbfilteronlinkedtable.cls.php.

DBFilterOnLinkedTable::$join_type [protected]

Definition at line 57 of file dbfilteronlinkedtable.cls.php.

DBFilterOnLinkedTable::$linked_table [protected]

Definition at line 43 of file dbfilteronlinkedtable.cls.php.


The documentation for this class was generated from the following file: