Stud.IP  jlu_4.3 Revision 64286
ResourceSearch Class Reference
Inheritance diagram for ResourceSearch:
Inheritance graph
Collaboration diagram for ResourceSearch:
Collaboration graph

Public Member Functions

 __construct ()
 
 setAcceptedPermissionLevels ($levels=[])
 
 getAcceptedPermissionLevels ()
 
 setUseOfGlobalPermissions ($use_global_permissions=true)
 
 getUseOfGlobalPermissions ()
 
 setAdditionalDisplayProperties ($properties=[])
 
 getAdditionalDisplayProperties ()
 
 setAdditionalPropertyFormat ($format='[%s]')
 
 getAdditionalPropertyFormat ()
 
 setSearchableResourceClasses ($classes=[])
 
 getSearchableResourceClasses ()
 
 getTitle ()
 
 getResults ( $keyword, $contextual_data=[], $limit=PHP_INT_MAX, $offset=0)
 
 includePath ()
 
- Public Member Functions inherited from SearchType
 getTitle ()
 
 getAvatar ($id)
 
 getAvatarImageTag ($id)
 
 getResults ($keyword, $contextual_data=array(), $limit=PHP_INT_MAX, $offset=0)
 
 includePath ()
 

Protected Attributes

 $accepted_permission_levels
 
 $use_global_permissions
 
 $additional_display_properties
 
 $additional_property_format
 
 $searchable_resource_classes
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Reimplemented in RoomSearch.

Member Function Documentation

◆ getAcceptedPermissionLevels()

getAcceptedPermissionLevels ( )

The getter method for the $accepted_permission_levels attribute.

Returns
string[]

◆ getAdditionalDisplayProperties()

getAdditionalDisplayProperties ( )

The getter method for the $additional_display_properties attribute.

Returns
array
See also
$additional_display_properties for the array format.

◆ getAdditionalPropertyFormat()

getAdditionalPropertyFormat ( )

The getter method for the $additional_property_format attribute.

Returns
string

◆ getResults()

getResults (   $keyword,
  $contextual_data = [],
  $limit = PHP_INT_MAX,
  $offset = 0 
)
Parameters
string$keywordThe name of the resource or a part of it.
array$contextual_dataThis parameter is not used at the moment.

Reimplemented from SearchType.

Reimplemented in RoomSearch.

Here is the call graph for this function:

◆ getSearchableResourceClasses()

getSearchableResourceClasses ( )

The getter method for the $searchable_resource_classes attribute.

Returns
array

◆ getTitle()

getTitle ( )

title of the search like "search for courses" or just "courses"

Returns
string

Reimplemented from SearchType.

Reimplemented in RoomSearch.

◆ getUseOfGlobalPermissions()

getUseOfGlobalPermissions ( )

The getter method for the $use_global_permission attribute.

Returns
bool

◆ includePath()

includePath ( )

Returns the path to this file, so that this class can be autoloaded and is always available when necessary. Should be: "return __file__;"

Returns
string path to this file

Reimplemented from SearchType.

◆ setAcceptedPermissionLevels()

setAcceptedPermissionLevels (   $levels = [])

The setter method for the $accepted_permission_levels attribute.

Parameters
string[]$accepted_permission_levelsThe new value for the attribute.

◆ setAdditionalDisplayProperties()

setAdditionalDisplayProperties (   $properties = [])

The setter method for the $additional_display_properties attribute.

Parameters
array$propertiesThe new value for the attribute.

◆ setAdditionalPropertyFormat()

setAdditionalPropertyFormat (   $format = '[%s]')

The setter method for the $additional_property_format attribute.

Parameters
string$formatThe new value for the attribute.

◆ setSearchableResourceClasses()

setSearchableResourceClasses (   $classes = [])

The setter method for the $searchable_resource_classes attribute.

Parameters
array$categoriesThe new value for the attribute.

◆ setUseOfGlobalPermissions()

setUseOfGlobalPermissions (   $use_global_permissions = true)

The setter method for the $use_global_permission attribute.

Parameters
bool$use_global_permissionsThe new value for the attribute.

Field Documentation

◆ $accepted_permission_levels

$accepted_permission_levels
protected

string[] Limits the search results to resources where a person has at least the permission levels specified in this attribute. Defaults to ['user', 'autor', 'tutor', 'admin'].

◆ $additional_display_properties

$additional_display_properties
protected

string[] Additional properties that shall be appended to the name of the resource. The array must be one-dimensional.

◆ $additional_property_format

$additional_property_format
protected

string A format specification for additional properties in the "sprintf syntax". This format specification must have only one placeholder named 's' in which the additional properties will be inserted, separated by the string ", ". This attribute defaults to '[s]'.

◆ $searchable_resource_classes

$searchable_resource_classes
protected

array Array of class_names of Resource classes that will be included in the search. An empty array will include all resource classes.

◆ $use_global_permissions

$use_global_permissions
protected

bool Whether to use global permissions when searching for resources where a person has permissions on (true) or not. Defaults to true.


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