1<?php
2
3
4namespace ComboStrap;
5
6
7use ComboStrap\Meta\Api\MetadataStore;
8use ComboStrap\Meta\Store\MetadataDokuWikiStore;
9
10/**
11 * Class MetadataArrayStore
12 * @package ComboStrap
13 * Represents the current dokuwiki array that can be read with {@link p_read_metadata()}
14 */
15class MetadataDokuWikiArrayStore extends MetadataSingleArrayStore
16{
17
18
19    public static function getOrCreateFromResource(ResourceCombo $resourceCombo, array $dokuWikiData = []): MetadataStore
20    {
21        if (isset($dokuWikiData[MetadataDokuWikiStore::CURRENT_METADATA])) {
22            $dokuWikiData = $dokuWikiData[MetadataDokuWikiStore::CURRENT_METADATA];
23        }
24        return new MetadataDokuWikiArrayStore($resourceCombo, $dokuWikiData);
25    }
26
27}
28