Example #1
0
 public static function uuid()
 {
     try {
         $uuid = Uuid::uuid4();
         return $uuid;
     } catch (UnsatisfiedDependencyException $e) {
         // Some dependency was not met. Either the method cannot be called on a
         // 32-bit system, or it can, but it relies on Moontoast\Math to be present.
         Logger::critical("Unable to generate Uuid: " . $e->getMessage());
         Logger::logException($e);
         return null;
     }
 }
Example #2
0
 public function update()
 {
     $dbConnection = PdoUtils::obtainConnection();
     if ($dbConnection == null) {
         return Message::ERROR_NO_DB_CONNECTION;
     }
     $dbConnection->beginTransaction();
     $result = false;
     try {
         $sessionDao = new SessionDao($dbConnection);
         $result = $sessionDao->update($this);
         $dbConnection->commit();
     } catch (\Exception $e) {
         $dbConnection->rollBack();
         Logger::logException($e);
     }
     PdoUtils::closeConnection($dbConnection);
     return $result;
 }