コード例 #1
0
ファイル: Index.php プロジェクト: lyonscf/bounded-context
 public function replace(Entity $entity)
 {
     if (!$this->exists($entity->id())) {
         throw new NotExists("Entity" . $entity->id()->serialize() . " does not exist in this index.");
     }
     $this->index[$entity->id()->serialize()] = $entity;
 }
コード例 #2
0
 public function equals(Entity $other)
 {
     return $this->id === $other->id();
 }