Permalink
Browse files

Merge branch 'master' of github.com:kanshin/CakeEntity

  • Loading branch information...
2 parents 107d5eb + 99c2e2f commit ee8a2a367163b2ee3849d3f3eb4fbab2cf4a8edb @basuke basuke committed Sep 20, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 models/entity.php
View
@@ -45,6 +45,14 @@ public function init(EntityModel $model, $data) {
}
}
+ public function isEqual($other) {
+ if (!$other) return false;
+ if (empty($other->id)) return false;
+ if (get_class($other) != get_class($this)) return false;
+
+ return strval($other->id) == strval($this->id);
+ }
+
public function getModel() {
return ClassRegistry::init($this->_name_);
}

0 comments on commit ee8a2a3

Please sign in to comment.