diff options
| author | Philipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de> | 2024-09-24 10:53:31 +0200 |
|---|---|---|
| committer | Philipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de> | 2024-09-24 10:53:31 +0200 |
| commit | 4459dd7917f4d1c34f40bb68f0e991e9c3d53e4c (patch) | |
| tree | 5c07151ae61276d334e88f6309c30d439a85c12e /lib/classes/Range.php | |
| parent | da0022e5c1abbf9825ae76debaabdff7e8623bb4 (diff) | |
| parent | 97a188592c679890a25c37ab78463add76a52ff7 (diff) | |
Merge branch 'main' into issue-3911issue-3911
Diffstat (limited to 'lib/classes/Range.php')
| -rw-r--r-- | lib/classes/Range.php | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/lib/classes/Range.php b/lib/classes/Range.php new file mode 100644 index 0000000..97aa074 --- /dev/null +++ b/lib/classes/Range.php @@ -0,0 +1,66 @@ +<?php +/** + * Generic range interface. Ranges may be a lot of things in Stud.IP. + * + * @author Jan-Hendrik Willms <tleilax+studip@gmail.com> + * @license GPL2 or any later version + */ +interface Range +{ + /** + * Returns a descriptive text for the range type. + * + * @return string + */ + public function describeRange(); + + /** + * Returns a unique identificator for the range type. + * + * @return string + */ + public function getRangeType(); + + /** + * Returns the id of the current range + * + * @return mixed (string|int) + */ + public function getRangeId(); + + /** + * Returns the full name of the range (in given format). + * + * @param string $format + * @return string + */ + public function getFullName($format = 'default'); + + /** + * Returns the configuration object for this range. + * @return RangeConfig + */ + public function getConfiguration(); + + /** + * Decides whether the user may access the range. + * + * @param string|null $user_id Optional id of a user, defaults to current user + * @return bool + */ + public function isAccessibleToUser($user_id = null); + + /** + * Decides whether the user may edit/alter the range. + * + * @param string|null $user_id Optional id of a user, defaults to current user + * @return bool + */ + public function isEditableByUser($user_id = null); + + + /** + * @return string A string representation of the Range instance. + */ + public function __toString() : string; +} |
