Add a guard against overlapping transactions.
[platal.git] / classes / pluser.php
index 187f131..746ec59 100644 (file)
@@ -146,6 +146,17 @@ abstract class PlUser implements PlUserInterface
         return $this->hruid;
     }
 
+    public function isMe($other)
+    {
+        if (!$other) {
+            return false;
+        } else if ($other instanceof PlUser) {
+            return $other->id() == $this->id();
+        } else {
+            return false;
+        }
+    }
+
     public function bestEmail()
     {
         if (!empty($this->bestalias)) {