Stud.IP  5.4
PermissionSearch Class Reference
Inheritance diagram for PermissionSearch:
SQLSearch SearchType

Public Member Functions

 __construct ($search, $title="", $avatarLike="user_id", $presets=[])
 
 getResults ($input, $contextual_data=[], $limit=PHP_INT_MAX, $offset=0)
 
 includePath ()
 
- Public Member Functions inherited from SearchType
 getTitle ()
 
 getAvatar ($id)
 
 getAvatarImageTag ($id)
 
 getResults ($keyword, $contextual_data=[], $limit=PHP_INT_MAX, $offset=0)
 
 __toString ()
 
 includePath ()
 

Additional Inherited Members

- Data Fields inherited from SearchType
 $extendedLayout = false
 

Detailed Description

Class of type SearchType used for searches with QuickSearch (lib/classes/QuickSearch.class.php). You can search for people with a given Stud.IP permission level, either globally or at an institute.

Author
Thomas Hackl

Constructor & Destructor Documentation

◆ __construct()

__construct (   $search,
  $title = "",
  $avatarLike = "user_id",
  $presets = [] 
)
Parameters
string$query,SQL with at least ":input" as parameter
array$presets,variables from the same form that should be used in this search. array("input_name" => "placeholder_in_sql_query")
Returns
void

Member Function Documentation

◆ getResults()

getResults (   $input,
  $contextual_data = [],
  $limit = PHP_INT_MAX,
  $offset = 0 
)

returns the results of a search Use the contextual_data variable to send more variables than just the input to the SQL. QuickSearch for example sends all other variables of the same <form>-tag here.

Parameters
inputstring: the search-word(s)
contextual_dataarray: an associative array with more variables
limitint: maximum number of results (default: all)
offsetint: return results starting from this row (default: 0)
Returns
array: array(array(), ...)

◆ includePath()

includePath ( )

A very simple overwrite of the same method from SearchType class. returns the absolute path to this class for autoincluding this class.

Returns
: path to this class

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