The first thought that comes to my mind:
class User extends Doctrine_Record { public function equals(User $user) { $left = $this->toArray(); $right = $user->toArray(); unset($left['id'], $left['created_at'], $left['updated_at']); unset($right['id'], $right['created_at'], $right['updated_at']); return $left == $right; } }
source share