Bravo3\Orm\Services\EntityManager::getMaintenanceMode PHP Method

getMaintenanceMode() public method

Get the state of the maintenance mode
public getMaintenanceMode ( ) : boolean
return boolean
    public function getMaintenanceMode()
    {
        return $this->maintenance_mode;
    }

Usage Example

Beispiel #1
0
 /**
  * Execute a function in maintenance mode
  *
  * @param callable $closure
  */
 protected function maintenanceOperation($closure)
 {
     $mode = $this->entity_manager->getMaintenanceMode();
     $this->entity_manager->setMaintenanceMode(true);
     try {
         $closure();
     } finally {
         $this->entity_manager->setMaintenanceMode($mode);
     }
 }