Stud.IP  6.0
StudipStudyAreaSelection Class Reference

Public Member Functions

 __construct ($course_id=NULL)
 
 getSearchKey ()
 
 setSearchKey ($searchKey)
 
 searched ()
 
 clearSearchResult ()
 
 getSearchResult ()
 
 getSelected ()
 
 setSelected ($selected)
 
 getShowAll ()
 
 setShowAll ($showAll)
 
 toggleShowAll ()
 
 getAreaIDs ()
 
 getAreas ()
 
 setAreas ($areas)
 
 includes ($area)
 
 size ()
 
 add ($area)
 
 remove ($area)
 
 getTrail ()
 

Static Public Member Functions

static sortSearchResult ($a, $b)
 

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 areas are populated by that course's already chosen study areas. 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 study areas.

Parameters
stringthe MD5ish ID of the study area to add
Returns
object this instance

◆ clearSearchResult()

clearSearchResult ( )

Clears the current search result.

Returns
object this instance

◆ getAreaIDs()

getAreaIDs ( )

Returns all the IDs of the selected study areas.

Returns
array an array of MD5ish strings representing the IDs of the selected study areas

◆ getAreas()

getAreas ( )

Returns all the selected study areas.

Returns
array an array of StudipStudyArea representing the selected study areas

◆ getSearchKey()

getSearchKey ( )
Returns
string the current search term

◆ getSearchResult()

getSearchResult ( )

Returns an array of search results. This result is memoized for performance though setting the search key anew clears the memo again.

Returns
array an array of search results

◆ getSelected()

getSelected ( )
Returns
object the currently selected study area

◆ 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 study areas down to the currently selected area.

TODO (mlunzena) this has to be refactored as well

Returns
array an array of study areas; currently each item is an hashmap containing the ID of each area using the key 'id' and the name of the study area using the key 'name'

◆ includes()

includes (   $area)
Parameters
mixedthe MD5ish ID of a study area or the area object itself
Returns
bool returns TRUE if this area is selected, FALSE otherwise

◆ remove()

remove (   $area)

This method removes an area from the selected study areas.

Parameters
stringthe MD5ish ID of the study area to add
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

◆ setAreas()

setAreas (   $areas)

Sets the study areas of this selection. One can provide either MD5ish ID strings or instances of StudipStudyArea.

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

◆ setSearchKey()

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

◆ setSelected()

setSelected (   $selected)
Parameters
mixedeither an MD5ish ID of the study area to select or the area 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 study areas

◆ 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: