Stud.IP
6.0
|
Static Public Member Functions | |
static | findBySearchTerm ($search_term, $filter=null) |
static | getAll () |
static | get ($id=null) |
static | getEnriched ($id) |
static | getEnrichedByQuery ($query=null, $params=[], $row_count=null, $offset=null) |
static | getClassDisplayName ($long=false) |
static | getFilterSql ($filter, $where=false, $or_sql=null) |
static | getContentArray (SimpleORMap $sorm, $to_utf8=true) |
static | getCount ($filter=null) |
static | getCountBySql ($sql, $filter=null) |
static | setLanguage ($language) |
static | setContentLanguage ($language) |
static | getLanguage () = htmlReady($modul['name']) |
static | getLocaleOrdinalNumberSuffix ($num) |
static | getPublicStatus ($class_name=null) |
static | findCached ($id, $index=null) |
static | clearCache ($index=null) |
Static Public Member Functions inherited from SimpleORMap | |
static | tableScheme ($db_table) |
static | expireTableScheme () |
static | exists ($id) |
static | countBySql ($sql='1', $params=[]) |
static | create ($data) |
static | build ($data, $is_new=true) |
static | buildExisting ($data) |
static | import ($data) |
static | findBySQL ($sql, $params=[]) |
static | findOneBySQL ($where, $params=[]) |
static | findThru ($foreign_key_value, $options) |
static | findEachBySQL ($callable, $sql, $params=[]) |
static | findMany ($pks=[], $order='', $order_params=[]) |
static | findEachMany ($callable, $pks=[], $order='', $order_params=[]) |
static | findAndMapBySQL ($callable, $where, $params=[]) |
static | findAndMapMany ($callable, $pks=[], $order='', $order_params=[]) |
static | deleteBySQL ($where, $params=[]) |
static | toObject ($id_or_object) |
static | __callStatic (string $name, array $arguments) |
Data Fields | |
$object_real_name = '' | |
Data Fields inherited from SimpleORMap | |
const | ID_SEPARATOR = '_' |
Protected Member Functions | |
logChanges ($action=null) | |
Protected Member Functions inherited from SimpleORMap | |
_getId ($field) | |
_setId ($field, $value) | |
_getAdditionalValueFromRelation ($field) | |
_setAdditionalValueFromRelation ($field, $value) | |
_getAdditionalValue ($field) | |
_setAdditionalValue ($field, $value) | |
parseRelationOptions ($type, $name, $options) | |
storeRelations ($only_these=null) | |
deleteRelations () | |
initializeContent () | |
applyCallbacks ($type) | |
cbNotificationMapper ($cb_type) | |
cbAfterInitialize ($cb_type) | |
setSerializedValue ($field, $value) | |
setI18nValue ($field, $value) | |
Static Protected Member Functions | |
static | configure ($config=[]) |
static | checkSortFields ($sort, $standard_field=null, $additional_fields=[]) |
static | createSortStatement ($sort, $order='ASC', $standard_field=null, $additional_fields=[]) |
static | fromCache ($index, $id, Callable $finder) |
static | formatDisplayName (string $template, array $placeholders, array $replacements) |
Static Protected Member Functions inherited from SimpleORMap | |
static | db_table () |
static | db_fields () |
static | pk () |
static | default_values () |
static | serialized_fields () |
static | alias_fields () |
static | i18n_fields () |
static | additional_fields () |
static | has_many () |
static | has_one () |
static | belongs_to () |
static | has_and_belongs_to_many () |
static | registered_callbacks () |
static | known_slots () |
static | notification_map () |
static | getter_setter_map () |
static | configure ($config=[]) |
static | config ($key) |
static | registerCallback ($types, $cb) |
static | unregisterCallback ($types, $cb) |
Protected Attributes | |
$is_dirty = false | |
Protected Attributes inherited from SimpleORMap | |
$content = [] | |
$content_db = [] | |
$is_new = true | |
$is_deleted = false | |
$relations = [] | |
$additional_data = [] | |
Static Protected Attributes | |
static | $filter_params = [] |
static | $perm_object = null |
static | $object_cache = [] |
Static Protected Attributes inherited from SimpleORMap | |
static | $config = [] |
static | $reserved_slots = ['value','newid','iterator','tablemetadata', 'relationvalue','wherequery','relationoptions','data','new','id'] |
static | $performs_batch_operation = false |
Additional Inherited Members | |
Static Public Attributes inherited from SimpleORMap | |
static | $schemes = null |
|
staticprotected |
Verifies a field name or an array of field names if they are permitted for sorting the result. If ok returns the given sort fields. If not, returns the given standard_field or null.
string | array | $sort | the fields to check |
string | $additional_fields | additional allowed fields |
|
static |
Clears the cache for a given index or completely. If this method is called on this abstract class, it will always clear the whole cache. Otherwise it will clear the cache for the subclass of this class or the given index.
mixed | $index | Optional index to clear |
|
staticprotected |
Common configuration for all module management models. This will ensure that the caches are flushed whenever an object changes or is removed.
array | $config | Configuration from derived class |
|
staticprotected |
Checks for valid fields and creates a sort statement for queries.
string | array | $sort | The field(s) to sort by. |
string | $order | The direction (ASC|DESC) |
string | $standard_field | |
array | $additional_fields | Calculated columns. |
delete | ( | ) |
|
static |
Returns a collection of a MVV object type found by search term optionally filtered.
string | $search_term | The term to search for. |
array | $filter | Filter parameters as key value pairs. |
|
static |
Locates and returns an item from cache
string | $id | Id of the item |
string | $index | Optional index for the cache, defaults to class name |
|
staticprotected |
Formats the name of the object by given template and appropriate placeholders and replacements.
string | $template | The template. |
array | $placeholders | All placeholders (words) without regeexp stuff. |
array | $values | Values to replace the placeholders. Empty strings will be ignored. |
Exception | If the template is not usable. |
|
staticprotected |
Loads an item from cache and retrieves and stores it if it is not present.
string | $index | Index for the cache |
string | $id | Id of the item |
Callable | $finder | Function to actually locate the item. |
|
static |
Returns an object by given id or a new object.
string | $id | The id of the object. |
|
static |
Returns an array of all objects of "self" type.
getAvailableTranslations | ( | ) |
|
static |
Returns the display name of this class.
|
static |
Returns an SimpleOrMap object as an Array. Its like a static version of SimpleOrMap::toArray but returns all content fields. Usefull as callback function.
SimpleORMap | $sorm | The SimpleOrMap object to transform |
bool | $to_utf8 | If true (default), the data will be utf8 transformed. |
|
static |
Returns the number of objects of this type. Optionally reduced by filter criteria.
array | An array with filter criteria. See ApplicationSimpleORMap::getFilter(). |
|
static |
Returns the number of rows found by the given sql and filters.
string | $sql | The sql query part. |
array | $filter | An array of filters with respect to the query part. |
getDisplayName | ( | ) |
Returns the name of the object to display in a specific context. The default is the value from the db fields "name" or "bezeichnung" or an empty string if no such fields exist. This method is overwritten by most of the mvv objects to display more complex names glued together from fields of related objects.
|
static |
Returns an object by given id with all relations and additional fields.
string | $id | The id of the object. |
|
static |
Enriches the model with data from other joined tables.
string | $query | complete sql with all fields in select statement from main table |
array | $params | Array with the parameters used in query |
int | $row_count | Number of rows to return |
int | $offset | Offset where the result set starts |
|
static |
Creates a sql clause to set constraints in a query by given filters.
The values of the given filters can be either a scalar value or an array.
If the value of the given filter is 'undefined' then it matches against NULL or an empty string.
If the column name has a comparison operator at its end (delimited by a blank), this operator is used.
To filter for semesters the column name has to be 'start_sem.beginn' for the start semester and 'end_sem.ende' for the end semester according to the joins with the semester_data table and table aliases in the sql statement.
array | $filter | An associative array with filters where the key is the column name to filter against the given value. |
bool | $where | if true returns a complete where statement |
string | SQL-where part glued with an "OR" at the end of the filter sql part. |
|
staticfinal |
Returns the currently selected language.
|
static |
Returns the suffix for ordinal numbers if the selected locale is EN or a simple point if not.
int | $num |
|
static |
Returns an array of all values for given class with status "public" defined by configuration.
getResponsibleInstitutes | ( | ) |
getStatus | ( | ) |
Returns the status of this object. Some MVV objects have a status declared in mvv_config.php.
getVariant | ( | ) |
Returns a string that identify a variant of this object. Returns an empty string if no variant exists for this object.
hasPublicStatus | ( | $filter = null | ) |
Returns whether this object has a public status. Public status means that this object is public visible. The possible status are defined in mvv_config.php. The set of possible status can be restricted by an optional filter. Only the statis given in filter are checkrd.
array | $filter | An array of status keys. |
|
protected |
Logs all changes of this object.
string | $action | new, update or delete |
|
static |
Switches the content to the given language. Compared to ModuleManagementModel::setLanguage() strings translated with gettext are always in the prefered language selected by the user.
string | $language | The language code (see mvv_config.php) |
|
staticfinal |
Sets the language for localized fields and the locale environment globally. Possible values are configured in mvv_config.php.
string | $language | The language. |
setNewId | ( | ) |
Sets a new id for this object.
store | ( | ) |
boolean | $validate | True to validate values. |
validate | ( | ) |
Validates the values before store. Throws an InvalidValuesException normally catched by form validation.
InvalidValuesException |
verifyPermission | ( | $user_id = null | ) |
Verifies whether the given user has sufficient rights to create, modify or delete this object and throws an exception if not.
string | $user_id | The user's id. |
Exception | if rights are not sufficient. |
|
staticprotected |
|
protected |
|
staticprotected |
$object_real_name = '' |
|
staticprotected |