Stud.IP  5.4
ExternPage Class Reference
Inheritance diagram for ExternPage:
ExternPageCourseDetails ExternPageCourses ExternPageDownload ExternPagePersBrowse ExternPagePersonDetails ExternPagePersons ExternPageTimetable

Public Member Functions

 __construct (ExternPageConfig $config)
 
 getSortFields ()
 
 getMarkersContents ()
 
 getDatafieldMarkers (SimpleORMap $sorm)
 
 getConfigFields (bool $as_array=false)
 
 __get (string $field)
 
 __set (string $field, $value)
 
 toString ()
 
 getValue (string $field)
 
 setValue (string $field, $value)
 
 getAllowedRequestParams (bool $as_array=false)
 
 setRequestParams ()
 
 store ()
 
 getInstitutes ()
 
 getStudyAreaPaths (string $delimiter=' > ')
 
 getDataFields (array $object_classes=[])
 

Static Public Member Functions

static get (ExternPageConfig $config)
 
static getGroupedSemTypes ()
 

Data Fields

 $page_config
 

Protected Member Functions

 getContentMembers (Course $course, $status)
 
 getSemesters ()
 
 getScopesSQL (array &$params, array $scopes, bool $with_kids)
 
 getInstitutesSQL (array &$params)
 

Static Protected Member Functions

static argsToArray (string $args)
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( ExternPageConfig  $config)

Constructor initialized with page configuration.

Parameters
ExternPageConfig$config

Member Function Documentation

◆ __get()

__get ( string  $field)

Magic method to get a value by given name from configuration.

Parameters
string$fieldThe name of the field.
Returns
mixed The value of the field.

◆ __set()

__set ( string  $field,
  $value 
)

Magic method to set a field in the configuration by given value.

Parameters
string$fieldThe field name.
mixed$valueThe value.

◆ argsToArray()

static argsToArray ( string  $args)
staticprotected

Convert string with allowed arguments to array with name as key and type as value.

Parameters
$argsstring String with allowed arguments.
Returns
array Associative array with arguments.

◆ get()

static get ( ExternPageConfig  $config)
static

Factory to get ExternPage object from config.

Parameters
ExternPageConfig$configThe page config.
Returns
ExternPage The module depending on config.
Exceptions
InvalidArgumentException

◆ getAllowedRequestParams()

getAllowedRequestParams ( bool  $as_array = false)
abstract

Returns a list (as string or array) with all names of config fields overridable by request parameters.

Parameters
false$as_arrayTrue to get request params as array.
Returns
string|string[]|void All allowed request params as array or string.

◆ getConfigFields()

getConfigFields ( bool  $as_array = false)
abstract

Returns an array or csv list of all parameter names and types used in the form to configure this external page. Used by Request::extract().

See also
Request::extract()
Parameters
false$as_arrayTrue to get config fields as array.
Returns
array|string An array or csv list of all field names and types.

◆ getContentMembers()

getContentMembers ( Course  $course,
  $status 
)
protected

Retrieves content of all members of given status as content array.

Parameters
Course$courseThe course.
string$statusStatus of membership.
Returns
array Array with content of course members.

◆ getDatafieldMarkers()

getDatafieldMarkers ( SimpleORMap  $sorm)

Returns all markers with content from datafields related with the given object. The name of the marker begins with DATFIELD_ followed by the id of the datafield.

Parameters
SimpleORMap$sormSorm-object with datafields.
Returns
array Markers for datafields.

◆ getDataFields()

getDataFields ( array  $object_classes = [])

Returns all datafields for the given datafield classes.

Parameters
array$object_classesArray of datafield class names.
Returns
DataField[] All datafields for given classes.

◆ getGroupedSemTypes()

static getGroupedSemTypes ( )
static

Returns types of courses grouped by classes.

Returns
array The grouped types.

◆ getInstitutes()

getInstitutes ( )

Returns an array of institutes names as values and their IDs as keys.

Exceptions
UnexpectedValueException;
Returns
array|false

◆ getInstitutesSQL()

getInstitutesSQL ( array &  $params)
protected

Returns SQL snippet to filter seminars by institutes if institute ids are stored in configuration. If no institutes stored in configuration it returns an empty string.

Parameters
array$paramsParameters of SQL statement.
Returns
string SQL snippet or empty string if no institute is configured.

◆ getMarkersContents()

getMarkersContents ( )
abstract

Returns an array with all content ready to feed it to the template.

Returns
array Array with content of all markers used in template.

◆ getScopesSQL()

getScopesSQL ( array &  $params,
array  $scopes,
bool  $with_kids 
)
protected

Returns SQL snippet to filter by study areas.

Parameters
array$paramsArray with query parameters.
array$scopesArray with selected scopes.
bool$with_kidsReturns all descendent ids of the given scopes.
Returns
string SQL snippet or empty string if no study area is configured.
Exceptions
Exception

◆ getSemesters()

getSemesters ( )
protected

Returns an array of semester ids depending on config value.

Returns
array Array of semester ids.

◆ getSortFields()

getSortFields ( )
abstract

Returns an associative array with field names as keys and the spoken name of fields as value. The output can be sorted by these values.

Returns
array Array of field names as keys and spoken names as values.

◆ getStudyAreaPaths()

getStudyAreaPaths ( string  $delimiter = ',
 
)

Returns an associative array with area ids as keys and the area paths up to tree root as value.

Parameters
string$delimiterDelimiter between area names in path.
Returns
array Array with area id as index and paths as value.
Exceptions
Exception

◆ getValue()

getValue ( string  $field)

Get a value from the configuration of this external page.

Parameters
string$fieldThe name of the field.
Returns
mixed The value of the field.

◆ setRequestParams()

setRequestParams ( )

Extract the allowed request params and overwrites the values from configuration.

◆ setValue()

setValue ( string  $field,
  $value 
)

Sets a value in the config storage by given field name.

Parameters
string$fieldThe name of the field.
mixed$valueThe value to set.

◆ store()

store ( )

Stores the configuration.

Returns
number|boolean

◆ toString()

toString ( )

Returns the processed template with all data from this external page.

Returns
string The processed template with content inserted.

Field Documentation

◆ $page_config

$page_config

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