Stud.IP  5.4
StudipLog Class Reference

Static Public Member Functions

static __callStatic ($name, $arguments)
 
static log ( $action_name, $affected=null, $coaffected=null, $info=null, $dbg_info=null, $user_id=null)
 
static registerAction ($name, $description, $info_template, $class)
 
static registerActionPlugin ($name, $description, $info_template, $plugin_class_name)
 
static registerActionFile ($name, $description, $info_template, $filename, $class)
 
static unregisterAction ($name)
 
static searchSeminar ($needle)
 
static searchInstitute ($needle)
 
static searchUser ($needle)
 
static searchResource ($needle)
 
static searchObjectByAction ($needle, $action_id)
 

Member Function Documentation

◆ __callStatic()

static __callStatic (   $name,
  $arguments 
)
static

Magic log, intercepts all undefined static method calls called method name must be the name of a log action

Parameters
string$name
array$arguments
Returns
boolean True if event was written or false if logging is disabled

◆ log()

static log (   $action_name,
  $affected = null,
  $coaffected = null,
  $info = null,
  $dbg_info = null,
  $user_id = null 
)
static

Logs an event to the database after a certain action took place along with the ids of the range object the action possibly affected. You can provide additional info as well as debug information.

Parameters
String$action_nameName of the action that took place
mixed$affectedRange id that was affected by the action, if any
mixed$coaffectedRange id that was possibly affected as well
mixed$infoInformation to add to the event
mixed$dbg_infoDebug information to add to the event
mixed$user_idProvide null for the current user id

◆ registerAction()

static registerAction (   $name,
  $description,
  $info_template,
  $class 
)
static

Registers a new log action in database. Use this function to register log actions for Stud.IP core objects.

Parameters
string$nameThe name of the action.
string$descriptionThe action's description.
string$info_templateThe template
string$className of the core class.

◆ registerActionFile()

static registerActionFile (   $name,
  $description,
  $info_template,
  $filename,
  $class 
)
static

Registers a new log action in database. Use this function to register log actions for arbitrary objects.

Parameters
string$nameThe name of the action.
string$descriptionThe action's description.
string$info_templateThe template
string$filenamePath to the file with the class (relative to Stud.IP root).
string$className of class to be logged.

◆ registerActionPlugin()

static registerActionPlugin (   $name,
  $description,
  $info_template,
  $plugin_class_name 
)
static

Registers a new log action in database. Use this function to register log actions for plugin classes.

Parameters
string$nameThe name of the action.
string$descriptionThe action's description.
string$info_templateThe template
string$plugin_class_nameName of the plugin class.

◆ searchInstitute()

static searchInstitute (   $needle)
static

Finds all institutes by given search string. Searches for the name of existing or already deleted institutes.

Parameters
type$needleThe needle to search for.
Returns
array

◆ searchObjectByAction()

static searchObjectByAction (   $needle,
  $action_id 
)
static

Finds all objects related to the given action by search string. The search string can be either a part of the name or the id of the object.

Calls the method Loggable::logSearch() to retrieve the result.

Parameters
string$needle
type$action_id
Returns
type

◆ searchResource()

static searchResource (   $needle)
static

Finds all resources by given search string. The search string can be either a resource id or part of the name.

Parameters
string$needleThe needle to search for.
Returns
array

◆ searchSeminar()

static searchSeminar (   $needle)
static

Finds all seminars by given search string. Searches for the name of existing or already deleted seminars.

Parameters
string$needleThe needle to search for.
Returns
array

◆ searchUser()

static searchUser (   $needle)
static

Finds all users by given search string. Searches for the users id, part of the name or the username.

Parameters
type$needleThe needle to search for.
Returns
array

◆ unregisterAction()

static unregisterAction (   $name)
static

Removes the action from database. Deletes all related log events also.

Parameters
string$nameThe name of the log action.
Returns
mixed Number of deleted objects or false if action is unknown.

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