Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
Instance Class Reference

Public Member Functions

 __construct (StructuralElement $root)
 
 getRoot ()
 
 getRange ()
 
 getRangeType ()
 
 getBlockTypes ()
 
 getContainerTypes ()
 
 setFavoriteBlockTypes (\User $user, array $favorites)
 
 getSequentialProgression ()
 
 setSequentialProgression (bool $isSequentialProgression)
 
 setEditingPermissionLevel (string $editingPermissionLevel)
 
 isValidEditingPermissionLevel (string $editingPermissionLevel)
 
 getUsersBookmarks (\User $user)
 
 findAllStructuralElements ()
 
 findAllBlocks ()
 
 findAllBlocksGroupedByStructuralElementId (callable $formatter=null)
 

Static Public Member Functions

static deleteForRange (\Range $range)
 

Data Fields

const EDITING_PERMISSION_DOZENT = 'dozent'
 
const EDITING_PERMISSION_TUTOR = 'tutor'
 

Detailed Description

This class represents an instance of a courseware of a course or a user.

Author
Marcus Eibrink-Lunzenauer lunze.nosp@m.naue.nosp@m.r@ela.nosp@m.n-ev.nosp@m..de
Ron Lucke lucke.nosp@m.@ela.nosp@m.n-ev..nosp@m.de GPL2 or any later version
Since
Stud.IP 5.0

Constructor & Destructor Documentation

__construct ( StructuralElement  $root)

Create a new representation of a a courseware instance.

This model class purely represents and does not create anything. Its purpose is to have all things related to a single courseware instance in one place.

Parameters
StructuralElement$rootthe root of this courseware instance

Member Function Documentation

static deleteForRange ( \Range  $range)
static
findAllBlocks ( )
findAllBlocksGroupedByStructuralElementId ( callable  $formatter = null)

Find all blocks of this instance and group them by their structural element's ID. You may specify your own $formatter instead of the default one which stores the blocks as instances of .

Parameters
?callable(array$row): mixed $formatter Provide your own callable if you need something else instead of full-blown instances of .
Returns
iterable all the (optionally formatted) blocks grouped by the IDs of the structural element containing that block.
findAllStructuralElements ( )
getBlockTypes ( )

Returns all associated block types registered to this courseware instance.

Returns
array a list of all associated block types
getContainerTypes ( )

Returns all associated container types registered to this courseware instance.

Returns
array a list of all associated block types
getRange ( )

Returns the range this courseware instance belongs to.

Returns
the range this courseware instance belongs to
getRangeType ( )

Returns the type of this courseware instance's range as coded in the root element.

Returns
string the type of this courseware instance's range
getRoot ( )

Returns the root element of this courseware instance.

Returns
StructuralElement the root element of this courseware instance
getSequentialProgression ( )

Returns whether this courseware instance uses a sequential progression through the structural elements.

Returns
bool true if this courseware instance uses a sequential progression, false otherwise
getUsersBookmarks ( \User  $user)

Returns all bookmarks of a user associated to this courseware instance.

Parameters
\User$userthe user for whom to find associated bookmarks for
Returns
array a list of the given user's bookmarks associated to this instance
isValidEditingPermissionLevel ( string  $editingPermissionLevel)

Validates a editing permission level.

Parameters
string$editingPermissionLevelthe editing permission level to validate
Returns
bool true if this editing permission level is valid, false otherwise
setEditingPermissionLevel ( string  $editingPermissionLevel)

Sets the level needed to edit this courseware instance.

Parameters
string$editingPermissionLevelcan be either Instance::EDITING_PERMISSION_DOZENT or Instance::EDITING_PERMISSION_TUTOR
setFavoriteBlockTypes ( \User  $user,
array  $favorites 
)

Sets a user's favorite block types for this courseware instance.

Parameters
\User$userthe user for whom the favorite block types will be set
array$favoritesthe list of favorite block types
setSequentialProgression ( bool  $isSequentialProgression)

Sets whether this courseware instance uses a sequential progression through the structural elements.

Parameters
bool$isSequentialProgressiontrue if this courseware instance uses a sequential progression

Field Documentation

const EDITING_PERMISSION_DOZENT = 'dozent'
const EDITING_PERMISSION_TUTOR = 'tutor'

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