originals[$id] = clone $schema; $this->schemas[$id] = $schema; } /** * Get a schema as it was when it was added * @param string $id * @throws common_exception_InconsistentData */ public function getOriginalSchema($id) : Schema { if (!isset($this->originals[$id])) { throw new common_exception_InconsistentData('Expected original schema '.$id.' not found'); } return $this->originals[$id]; } /** * Get a schema in its current form, might have been changed * @param string $id * @throws common_exception_InconsistentData * @return Schema */ public function getSchema($id) : Schema { if (!isset($this->schemas[$id])) { throw new common_exception_InconsistentData('Expected schema '.$id.' not found'); } return $this->schemas[$id]; } /** * {@inheritDoc} * @see IteratorAggregate::getIterator() */ public function getIterator() { return new ArrayIterator($this->schemas); } }