Framework  3.9
CrossReferenceSearchParameterHandler Class Reference
+ Inheritance diagram for CrossReferenceSearchParameterHandler:
+ Collaboration diagram for CrossReferenceSearchParameterHandler:

Public Member Functions

 __construct ($class, $xref, $foreignKey)
 
 member ($name, $set)
 Generate the constraint expression for set membership matching paramters, matching values in a comma delimite set. More...
 
- Public Member Functions inherited from SearchParameterHandler
 equal ($name, $value)
 Generates the constraint expression for equality matching parameters. More...
 
 like ($name, $value)
 Generates the constraint expression for 'like' matching parameters, i.e. More...
 
 startsWith ($name, $value)
 Generates the constraint expression for 'startsWith' matching parameters, i.e. More...
 
 from ($name, $from)
 Generates the constraint expression for 'from' matching parameters, i.e. More...
 
 to ($name, $to)
 Generates the constraint expression for 'to' matching parameters, i.e. More...
 
 range ($name, $from, $to)
 Generates the constraint expression for 'range' matching parameters, i.e. More...
 
 any ($name, $value)
 Generate the constraint expression for matching any word in a group of words. More...
 
 all ($name, $value)
 Generate the constraint expression for matching all words in a group of words but allowing other words in between. More...
 
 fullName ($f_name, $l_name, $value)
 Generate the constraint expression for matching the f_name and l_name fields to a given value. More...
 
 checked ($name, $value)
 Generate the constraint expresssion for matching boolean only when the UI element is selected. More...
 

Public Attributes

 $cl
 
 $xref
 
 $foreignKey
 

Detailed Description

Definition at line 486 of file search_form.inc.

Constructor & Destructor Documentation

◆ __construct()

CrossReferenceSearchParameterHandler::__construct (   $class,
  $xref,
  $foreignKey 
)

Definition at line 492 of file search_form.inc.

493  {
494  $this->cl = $class;
495  $this->xref = $xref;
496  $this->foreignKey = $foreignKey;
497  }

Member Function Documentation

◆ member()

CrossReferenceSearchParameterHandler::member (   $name,
  $set 
)

Generate the constraint expression for set membership matching paramters, matching values in a comma delimite set.

Parameters
string$namethe name of the field
string$seta comma delimited set of values to match
Returns
string a SQL expression to peform the match

Reimplemented from SearchParameterHandler.

Definition at line 499 of file search_form.inc.

500  {
501  $values = $set;
502  if(is_array($set))
503  $values = implode(",", array_keys($set));
504 
505  if (!$set) return "";
506 
507  trace("## Generating cross reference terms for $name using values ($values)", 3);
508 
509  $xref = new $this->xref;
510  $obj = new $this->cl;
511  $pk = $obj->getPrimaryKey();
512 
513  return "$pk IN (SELECT {$pk} FROM {$xref->table} WHERE {$this->foreignKey} IN ($set))";
514  }
trace($msg, $lvl=3, $callStack=null)
Send output to the trace log.
Definition: functions.inc:1010

Member Data Documentation

◆ $cl

CrossReferenceSearchParameterHandler::$cl

Definition at line 488 of file search_form.inc.

◆ $foreignKey

CrossReferenceSearchParameterHandler::$foreignKey

Definition at line 490 of file search_form.inc.

◆ $xref

CrossReferenceSearchParameterHandler::$xref

Definition at line 489 of file search_form.inc.


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