Example #1
0
 public function compare(\Stratum\Model\ModelObject $other)
 {
     $same = true;
     foreach ($other->expose_set() as $attr => $value) {
         $mine = $this->get($attr);
         if ($mine != $value) {
             $same = false;
         }
     }
     if ($same) {
         //should compare the other way, since the comparison skips empty values
         foreach ($this->expose_set() as $attr => $value) {
             $theirs = $other->get($attr);
             if ($theirs != $value) {
                 $same = false;
             }
         }
     }
     return $same;
 }