Methods summary
public
|
|
public
cApiInUse |null
|
#
markInUse( string $type, mixed $objectid, string $session, string $user )
Marks a specific object as "in use". Note that items are released when the
session is destroyed. Currently, the following types are defined and approved as
internal CONTENIDO standard: - article - module - layout - template
Marks a specific object as "in use". Note that items are released when the
session is destroyed. Currently, the following types are defined and approved as
internal CONTENIDO standard: - article - module - layout - template
Parameters
- $type
string $type Specifies the type to mark.
- $objectid
mixed $objectid Specifies the object ID
- $session
string $session Specifies the session for which the "in use" mark is valid
- $user
string $user Specifies the user which requested the in-use flag
Returns
|
public
|
#
removeMark( string $type, mixed $objectid, string $session )
Removes the "in use" mark from a specific object.
Removes the "in use" mark from a specific object.
Parameters
- $type
string $type Specifies the type to de-mark.
- $objectid
mixed $objectid Specifies the object ID
- $session
string $session Specifies the session for which the "in use" mark is valid
|
public
|
#
removeTypeMarks( string $type, string $session )
Removes all marks for a specific type and session
Removes all marks for a specific type and session
Parameters
- $type
string $type Specifies the type to de-mark.
- $session
string $session Specifies the session for which the "in use" mark is valid
|
public
|
#
removeItemMarks( string $type, string $itemid )
Removes the mark for a specific item
Removes the mark for a specific item
Parameters
- $type
string $type Specifies the type to de-mark.
- $itemid
string $itemid Specifies the item
|
public
|
#
removeUserMarks( string $userId )
Removes all in-use marks for a specific userId
Removes all in-use marks for a specific userId
Parameters
- $userId
string $userId Specifies the user
|
public
|
#
removeOldMarks( )
Removes all inuse entries which are older than the inuse timeout
Removes all inuse entries which are older than the inuse timeout
|
public
|
#
removeSessionMarks( string $session )
Removes all in-use marks for a specific session.
Removes all in-use marks for a specific session.
Parameters
- $session
string $session Specifies the session for which the "in use" marks should be removed
|
public
cApiInUse
|
#
checkMark( string $type, mixed $objectid )
Checks if a specific item is marked
Checks if a specific item is marked
Parameters
- $type
string $type Specifies the type to de-mark.
- $objectid
mixed $objectid Specifies the object ID
Returns
cApiInUse
bool false if it's not in use or returns the object if it is.
|
public
boolean
|
#
checkAndMark( string $type, mixed $objectid, boolean $returnWarning = false, string $warningTemplate = '', boolean $allowOverride = false, string $location = '' )
Checks and marks if not marked. Example: Check for "idmod", also return a
lock message: list($inUse, $message) = $col->checkAndMark("idmod", $idmod,
true, i18n("Module is in use by %s (%s)")); Example 2: Check for "idmod", don't
return a lock message $inUse = $col->checkAndMark("idmod", $idmod);
Checks and marks if not marked. Example: Check for "idmod", also return a
lock message: list($inUse, $message) = $col->checkAndMark("idmod", $idmod,
true, i18n("Module is in use by %s (%s)")); Example 2: Check for "idmod", don't
return a lock message $inUse = $col->checkAndMark("idmod", $idmod);
Parameters
- $type
string $type Specifies the type to de-mark.
- $objectid
mixed $objectid Specifies the object ID
- $returnWarning
boolean $returnWarning If true, also returns an error message if in use
- $warningTemplate
string $warningTemplate String to fill with the template (%s as placeholder, first %s
is the username, second is the real name)
- $allowOverride
boolean $allowOverride True if the user can override the lock
- $location
string $location Value to append to the override lock button
Returns
boolean array returnWarning is false, returns a bool value wether the object is locked.
If returnWarning is true, returns a 2 item array (bool inUse, string
errormessage).
|