From: daniel Date: Mon, 23 Apr 2012 16:16:04 +0000 (+0200) Subject: fixing Content::equals(): removing debug code, etc X-Git-Tag: 1.31.0-rc.0~22097^2^2~218 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=346cbf8d06b56aa0343ff175d0458b529b6b4f31;p=lhc%2Fweb%2Fwiklou.git fixing Content::equals(): removing debug code, etc --- 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; }