| 
|   | __construct ($key, $factory) | 
|   | Construct a lock containing the unique key required to release it.  More...
  | 
|   | 
| 
  | __destruct () | 
|   | Print debugging if this lock falls out of scope before being released. 
  | 
|   | 
|   | extend ($maxlifetime=86400) | 
|   | Extend the lifetime of this lock.  More...
  | 
|   | 
|   | get_key () | 
|   | Return the unique key representing this lock.  More...
  | 
|   | 
|   | release () | 
|   | Release this lock.  More...
  | 
|   | 
 | 
| 
string  | $caller = 'unknown' | 
|   | $caller Where was this called from? Stored for when a warning is shown 
  | 
|   | 
| 
lock_factory  | $factory | 
|   | $factory The factory that generated this lock 
  | 
|   | 
| 
string int  | $key = '' | 
|   | $key A unique key representing a held lock 
  | 
|   | 
| 
bool  | $released | 
|   | $released Has this lock been released? If a lock falls out of scope without being released - show a warning. 
  | 
|   | 
◆ __construct()
      
        
          | core\lock\lock::__construct  | 
          ( | 
            | 
          $key,  | 
        
        
           | 
           | 
            | 
          $factory  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Construct a lock containing the unique key required to release it. 
- Parameters
 - 
  
    | mixed | $key | - The lock key. The type of this is up to the lock_factory being used. For file locks this is a file handle. For MySQL this is a string.  | 
    | lock_factory | $factory | - The factory that generated this lock.  | 
  
   
 
 
◆ extend()
      
        
          | core\lock\lock::extend  | 
          ( | 
            | 
          $maxlifetime = 86400 | ) | 
           | 
        
      
 
Extend the lifetime of this lock. 
Not supported by all factories.
- Deprecated:
 - since Moodle 3.10. 
 
- Parameters
 - 
  
    | int | $maxlifetime | - the new lifetime for the lock (in seconds).  | 
  
   
- Return values
 - 
  
  
 
 
 
◆ get_key()
      
        
          | core\lock\lock::get_key  | 
          ( | 
           | ) | 
           | 
        
      
 
Return the unique key representing this lock. 
- Return values
 - 
  
  
 
 
 
◆ release()
      
        
          | core\lock\lock::release  | 
          ( | 
           | ) | 
           | 
        
      
 
Release this lock. 
- Return values
 - 
  
  
 
 
 
The documentation for this class was generated from the following file:
- lib/classes/lock/lock.php