Sponsorenverwaltung - Team StarCraft e.V.
 All Data Structures Files Functions Variables
functions_locks.php File Reference

This file bundles most of the functions needed for mutual exclusion to prevent lost update problems. More...

Go to the source code of this file.

Functions

 getTableRowLock ($tableName, $whereColumn, $whereValue)
 
 unlockTableRow ($tableName, $whereColumn, $whereValue)
 
 lockTableRow ($tableName, $whereColumn, $whereValue, $lockUntil)
 
 getTableNameForEditSection ($secId)
 
 isSponsorEditSectionLocked ($secId, $sponsorId)
 
 lockSponsorEditSection ($secId, $sponsorId)
 
 unlockSponsorEditSection ($secId, $sponsorId)
 
 renewSponsorEditSectionLock ($secId, $sponsorId)
 
 isProductionFacilityLocked ($id)
 
 lockProductionFacility ($id)
 
 unlockProductionFacility ($id)
 
 renewProductionFacilityLock ($id)
 
 isStatusLocked ($id)
 
 lockStatus ($id)
 
 unlockStatus ($id)
 
 renewStatusLock ($id)
 
 isCategoryLocked ($id)
 
 lockCategory ($id)
 
 unlockCategory ($id)
 
 renewCategoryLock ($id)
 
 isCarLocked ($id)
 
 lockCar ($id)
 
 unlockCar ($id)
 
 renewCarLock ($id)
 

Detailed Description

This file bundles most of the functions needed for mutual exclusion to prevent lost update problems.

This file bundles most of the functions needed for mutual exclusive working on shared datasets to prevent lost update problems and similar problems.

This file is linked with the other funcions via the inc/common.php.

Version
1.0.0
Author
Daniel Seichter
Date
02.07.2013

Definition in file functions_locks.php.

Function Documentation

getTableNameForEditSection (   $secId)

Gets the table name corresponding to the edit section (used in lock functions)

Parameters
integer$secIdid of the edit section
Returns
mixed
  • table name string corresponding to the edit section
  • FALSE if there is no table name for this section
Author
Daniel Seichter

Definition at line 126 of file functions_locks.php.

References $db.

Referenced by isSponsorEditSectionLocked(), lockSponsorEditSection(), renewSponsorEditSectionLock(), and unlockSponsorEditSection().

+ Here is the caller graph for this function:

getTableRowLock (   $tableName,
  $whereColumn,
  $whereValue 
)

Gets the lock state of a table row

Parameters
string$tableNamename of the table in the database
string$whereColumncolumn of the table row to compare
integer$whereValuerequired value in the column
Returns
mixed
  • FALSE if the table row is not locked
  • user id if the table row is locked by the current user
  • TRUE if the table row is locked by another user
Author
Daniel Seichter

Definition at line 32 of file functions_locks.php.

References $db, and $mysqli.

Referenced by isCarLocked(), isCategoryLocked(), isProductionFacilityLocked(), isSponsorEditSectionLocked(), isStatusLocked(), renewCarLock(), renewCategoryLock(), renewProductionFacilityLock(), renewSponsorEditSectionLock(), renewStatusLock(), and unlockTableRow().

+ Here is the caller graph for this function:

isCarLocked (   $id)

Checks if the car is locked (dropdown fields)

Parameters
integer$idof the status
Returns
boolean TRUE if the car is locked, else FALSE
Author
Daniel Seichter

Definition at line 399 of file functions_locks.php.

References $db, and getTableRowLock().

+ Here is the call graph for this function:

isCategoryLocked (   $id)

Checks if the category is locked (dropdown fields)

Parameters
integer$idof the status
Returns
boolean TRUE if the category is locked, else FALSE
Author
Daniel Seichter

Definition at line 345 of file functions_locks.php.

References $db, and getTableRowLock().

+ Here is the call graph for this function:

isProductionFacilityLocked (   $id)

Checks if the production facility is locked (dropdown fields)

Parameters
integer$idof the production facility
Returns
boolean TRUE if the production facility is locked, else FALSE
Author
Daniel Seichter

Definition at line 237 of file functions_locks.php.

References $db, and getTableRowLock().

+ Here is the call graph for this function:

isSponsorEditSectionLocked (   $secId,
  $sponsorId 
)

Checks if a sponsor edit section is locked

Parameters
integer$secIdid of the edit section
integer$sponsorIdid of the current edited sponsor
Returns
boolean TRUE if edit section is locked, else FALSE
Author
Daniel Seichter

Definition at line 153 of file functions_locks.php.

References getTableNameForEditSection(), and getTableRowLock().

Referenced by deleteSponsor().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

isStatusLocked (   $id)

Checks if the status is locked (dropdown fields)

Parameters
integer$idof the status
Returns
boolean TRUE if the status is locked, else FALSE
Author
Daniel Seichter

Definition at line 291 of file functions_locks.php.

References $db, and getTableRowLock().

+ Here is the call graph for this function:

lockCar (   $id)

Locks the car (dropdown fields)

Parameters
integer$idof the car
Returns
boolean FALSE if an error occured
Author
Daniel Seichter

Definition at line 415 of file functions_locks.php.

References $db, EDIT_SECTION_LOCK_DURATION, and lockTableRow().

Referenced by renewCarLock().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

lockCategory (   $id)

Locks the category (dropdown fields)

Parameters
integer$idof the category
Returns
boolean FALSE if an error occured
Author
Daniel Seichter

Definition at line 361 of file functions_locks.php.

References $db, EDIT_SECTION_LOCK_DURATION, and lockTableRow().

Referenced by renewCategoryLock().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

lockProductionFacility (   $id)

Locks the production facility (dropdown fields)

Parameters
integer$idof the production facility
Returns
boolean FALSE if an error occured
Author
Daniel Seichter

Definition at line 253 of file functions_locks.php.

References $db, EDIT_SECTION_LOCK_DURATION, and lockTableRow().

Referenced by renewProductionFacilityLock().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

lockSponsorEditSection (   $secId,
  $sponsorId 
)

Locks a sponsor edit section

Parameters
integer$secIdid of the edit section
integer$sponsorIdid of the current edited sponsor
Returns
boolean FALSE if an error occured
Author
Daniel Seichter

Definition at line 179 of file functions_locks.php.

References EDIT_SECTION_LOCK_DURATION, getTableNameForEditSection(), and lockTableRow().

Referenced by deleteSponsor().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

lockStatus (   $id)

Locks the status (dropdown fields)

Parameters
integer$idof the status
Returns
boolean FALSE if an error occured
Author
Daniel Seichter

Definition at line 307 of file functions_locks.php.

References $db, EDIT_SECTION_LOCK_DURATION, and lockTableRow().

Referenced by renewStatusLock().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

lockTableRow (   $tableName,
  $whereColumn,
  $whereValue,
  $lockUntil 
)

Locks a table row in the database by adding a lock time and the lock user id

Parameters
string$tableNamename of the table in the database
string$whereColumncolumn of the table row to compare
integer$whereValuerequired value in the column
integer$lockUntiluntil this time the entry is locked
Returns
boolean FALSE if an error occured
Author
Daniel Seichter

Definition at line 107 of file functions_locks.php.

References $db, and $mysqli.

Referenced by lockCar(), lockCategory(), lockProductionFacility(), lockSponsorEditSection(), lockStatus(), and renewSponsorEditSectionLock().

+ Here is the caller graph for this function:

renewCarLock (   $id)

Renews the the lock time of the car (dropdown fields)

Parameters
integer$idof the car
Returns
boolean FALSE if an error occured
Author
Daniel Seichter

Definition at line 439 of file functions_locks.php.

References $db, getTableRowLock(), and lockCar().

+ Here is the call graph for this function:

renewCategoryLock (   $id)

Renews the the lock time of the category (dropdown fields)

Parameters
integer$idof the category
Returns
boolean FALSE if an error occured
Author
Daniel Seichter

Definition at line 385 of file functions_locks.php.

References $db, getTableRowLock(), and lockCategory().

+ Here is the call graph for this function:

renewProductionFacilityLock (   $id)

Renews the the lock time of the production facility (dropdown fields)

Parameters
integer$idof the production facility
Returns
boolean FALSE if an error occured
Author
Daniel Seichter

Definition at line 277 of file functions_locks.php.

References $db, getTableRowLock(), and lockProductionFacility().

+ Here is the call graph for this function:

renewSponsorEditSectionLock (   $secId,
  $sponsorId 
)

Renews the the lock time of a sponsor edit section

Parameters
integer$secIdid of the edit section
integer$sponsorIdid of the current edited sponsor
Returns
boolean FALSE if an error occured
Author
Daniel Seichter

Definition at line 215 of file functions_locks.php.

References EDIT_SECTION_LOCK_DURATION, getTableNameForEditSection(), getTableRowLock(), and lockTableRow().

+ Here is the call graph for this function:

renewStatusLock (   $id)

Renews the the lock time of the status (dropdown fields)

Parameters
integer$idof the status
Returns
boolean FALSE if an error occured
Author
Daniel Seichter

Definition at line 331 of file functions_locks.php.

References $db, getTableRowLock(), and lockStatus().

+ Here is the call graph for this function:

unlockCar (   $id)

Unlocks the car (dropdown fields)

Parameters
integer$idof the car
Returns
boolean FALSE if an error occured
Author
Daniel Seichter

Definition at line 428 of file functions_locks.php.

References $db, and unlockTableRow().

+ Here is the call graph for this function:

unlockCategory (   $id)

Unlock the category (dropdown fields)

Parameters
integer$idof the category
Returns
boolean FALSE if an error occured
Author
Daniel Seichter

Definition at line 374 of file functions_locks.php.

References $db, and unlockTableRow().

+ Here is the call graph for this function:

unlockProductionFacility (   $id)

Unlocks the production facility (dropdown fields)

Parameters
integer$idof the production facility
Returns
boolean FALSE if an error occured
Author
Daniel Seichter

Definition at line 266 of file functions_locks.php.

References $db, and unlockTableRow().

+ Here is the call graph for this function:

unlockSponsorEditSection (   $secId,
  $sponsorId 
)

Unlocks a sponsor edit section

Parameters
integer$secIdid of the edit section
integer$sponsorIdid of the current edited sponsor
Returns
boolean FALSE if an error occured
Author
Daniel Seichter

Definition at line 198 of file functions_locks.php.

References getTableNameForEditSection(), and unlockTableRow().

Referenced by deleteSponsor().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unlockStatus (   $id)

Unlock the status (dropdown fields)

Parameters
integer$idof the status
Returns
boolean FALSE if an error occured
Author
Daniel Seichter

Definition at line 320 of file functions_locks.php.

References $db, and unlockTableRow().

+ Here is the call graph for this function:

unlockTableRow (   $tableName,
  $whereColumn,
  $whereValue 
)

Unlocks a table row in the database by removing the lock time and the lock user id

Parameters
string$tableNamename of the table in the database
string$whereColumncolumn of the table row to compare
integer$whereValuerequired value in the column
Returns
boolean TRUE if the table row could be unlocked, else FALSE
Author
Daniel Seichter

Definition at line 76 of file functions_locks.php.

References $mysqli, and getTableRowLock().

Referenced by unlockCar(), unlockCategory(), unlockProductionFacility(), unlockSponsorEditSection(), and unlockStatus().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: