Stud.IP  5.4
StudipLvgruppeSelection Class Reference

Public Member Functions

 __construct ($course_id=null)
 
 getSearchKey ()
 
 setSearchKey ($searchKey)
 
 searched ()
 
 clearSearchResult ()
 
 getSearchResult ()
 
 getSelected ()
 
 setSelected ($selected, $type=null)
 
 getShowAll ()
 
 setShowAll ($showAll)
 
 toggleShowAll ()
 
 getLvGruppenIDs ()
 
 getAreas ()
 
 setLvgruppen ($areas)
 
 includes ($area)
 
 size ()
 
 add ($area)
 
 remove ($area)
 
 getTrail ()
 

Static Public Member Functions

static getRootItem ()
 
static sortSearchResult ($a, $b)
 

Detailed Description

Objects of this class represent the state of the LV-Gruppe selection form.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $course_id = null)

This constructor can be called with or without a course ID. If a course ID has been sent, the selected lvgruppen are populated by that course's already chosen lvgruppen. If no course ID is given, it is assumed that you are creating a new course at the moment.

Parameters
stringoptional; the ID of the course to prepopulate the form with
Returns
void

Member Function Documentation

◆ add()

add (   $area)

This method adds an area to the selected LV-Gruppen.

Parameters
mixedthe ID of the LV-Gruppe to add or a LV-Gruppe object
Returns
object this instance

◆ clearSearchResult()

clearSearchResult ( )

Clears the current search result.

Returns
object this instance

◆ getAreas()

getAreas ( )

Returns all the selected LV-Gruppen.

Returns
array an array of LV-Gruppen representing the selected LV-Gruppen

◆ getLvGruppenIDs()

getLvGruppenIDs ( )

Returns all the IDs of the already selected LV-Gruppen.

Returns
array an array with IDs of the selected LV-Gruppen

◆ getRootItem()

static getRootItem ( )
static

Returns the not really existing root of the tree.

Returns
object the root tree object

◆ getSearchKey()

getSearchKey ( )
Returns
string the current search term

◆ getSearchResult()

getSearchResult ( )

Returns an array of search results.

Returns
array an array of search results

◆ getSelected()

getSelected ( )
Returns
object the currently selected lvgruppe

◆ getShowAll()

getShowAll ( )
Returns
bool returns TRUE if the subtrees should be expanded completely or FALSE otherwise

◆ getTrail()

getTrail ( )

Returns the trail – the path from the root of the tree of MVV objects down to the currently selected LV-Gruppe.

Returns
array an array of MVV objects

◆ includes()

includes (   $area)

Returns true if this LV-Gruppe is selected, false otherwise.

Parameters
mixedthe id of a LV-Gruppe or the LV-Gruppe object itself
Returns
bool returns true if selected, false otherwise

◆ remove()

remove (   $area)

This method removes given LV-Gruppe from the already selected LV-Gruppen.

Parameters
mixedthe ID of the LV-Gruppe to add or a LV-Gruppe object
Returns
object this instance

◆ searched()

searched ( )
Returns
bool returns TRUE if the search key was set meaning that we are currently searching; returns FALSE otherwise

◆ setLvgruppen()

setLvgruppen (   $areas)

Sets the LV-Gruppen of this selection. One can provide either MD5ish ID strings or instances of Lvgruppe.

Parameters
arrayan array of either MD5ish ID strings or Lvgruppe
Returns
object the called instance itself

◆ setSearchKey()

setSearchKey (   $searchKey)
Parameters
stringa search term
Returns
object this instance

◆ setSelected()

setSelected (   $selected,
  $type = null 
)

Sets the selected tree item.

Parameters
mixed$selectedEither the id of a tree item to select or the tree item object itself
Returns
object this instance

◆ setShowAll()

setShowAll (   $showAll)
Parameters
boolthe new state of the expansion of subtrees
Returns
object this instance

◆ size()

size ( )
Returns
integer returns the number of the selected LV-Gruppen

◆ sortSearchResult()

static sortSearchResult (   $a,
  $b 
)
static

◆ toggleShowAll()

toggleShowAll ( )

Toggles the state of the expansion of subtrees.

Returns
object this instance

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