From 346cbf8d06b56aa0343ff175d0458b529b6b4f31 Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 23 Apr 2012 18:16:04 +0200 Subject: [PATCH] fixing Content::equals(): removing debug code, etc --- includes/Content.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/includes/Content.php b/includes/Content.php index 8349068f83..e3b26a696f 100644 --- a/includes/Content.php +++ b/includes/Content.php @@ -171,6 +171,8 @@ abstract class Content { * Will returns false if $that is null. * Will return true if $that === $this. * Will return false if $that->getModleName() != $this->getModelName(). + * Will return false if $that->getNativeData() is not equal to $this->getNativeData(), + * where the meaning of "equal" depends on the actual data model. * * Implementations should be careful to make equals() transitive and reflexive: * @@ -178,17 +180,13 @@ abstract class Content { * * $a->equals( $b ) && $b->equals( $c ) ==> $a->equals( $c ) * * @param Content $that the Content object to compare to - * @return bool true if this Content object is euzqla to $that, false otherwise. + * @return bool true if this Content object is euqual to $that, false otherwise. */ public function equals( Content $that = null ) { - if ( empty( $that ) ){ // FIXME: empty on an object? + if ( is_null( $that ) ){ return false; } - return false; - // FIXME: something is doing wrong here, causing the compared objects to always be the same. - // Hence returning false for now, so changes can actually be saved... - if ( $that === $this ) { return true; } -- 2.20.1