From f9d82a6ac588bfc5458d063d172513263eac0073 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Fri, 10 Jul 2015 12:19:08 +0200 Subject: [PATCH] Easy comparison of two Profile objects --- classes/Profile.php | 5 +++++ classes/User.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/classes/Profile.php b/classes/Profile.php index f78cd34e36..f628965a74 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -1571,6 +1571,11 @@ class Profile extends Managed_DataObject return $this; } + public function sameAs(Profile $other) + { + return $this->getID() === $other->getID(); + } + /** * This will perform shortenLinks with the connected User object. * diff --git a/classes/User.php b/classes/User.php index 9ae0cba804..72510f162c 100644 --- a/classes/User.php +++ b/classes/User.php @@ -132,6 +132,11 @@ class User extends Managed_DataObject return $this->_profile[$this->id]; } + public function sameAs(Profile $other) + { + return $this->getProfile()->sameAs($other); + } + public function getUri() { return $this->uri;