public function getMetadata($section = null, $key = null)
    {
        if (null === $section) {
            return $this->metadata;
        }
        foreach ($this->metadata as $md) {
            /** @var MetaData $md */
            if ($section != $md->getSection()) {
                continue;
            }
            if (null === $key) {
                return $md;
            }
            foreach ($md->getData() as $k => $data) {
                if ($key == $k) {
                    return $data;
                }
            }
            throw new NotFoundException('No metadata with section "' . $section . '" and key "' . $key . '" exists.');
        }
        throw new NotFoundException('No metadata with section "' . $section . '" exists.');
    }