/** * Adds an entry to the directory. * * @param PelEntry the entry that will be added. If the entry is not * valid in this IFD (as per {@link isValidTag()}) an * {@link PelInvalidDataException} is thrown. * * @todo The entry will be identified with its tag, so each * directory can only contain one entry with each tag. Is this a * bug? */ function addEntry(PelEntry $e) { if ($this->isValidTag($e->getTag())) { $e->setIfdType($this->type); $this->entries[$e->getTag()] = $e; } else { throw new PelInvalidDataException("IFD %s cannot hold\n%s", $this->getName(), $e->__toString()); } }