model instances equality

what is the best way of checking if two model instances are equal (all attributes have exactly the same values, maybe with the exception of the primary key (it may be e.g. null in one case))

default method is:


$someModel->equals( $anotherModel );

but you can override it to check attributes (using array_diff function)

thank you!