Airship\Cabin\Bridge\Blueprint\Skyport::getMotifPath PHP Method

getMotifPath() protected method

Locate the path that hosts the motif
protected getMotifPath ( string $cabin, array $info ) : array
$cabin string
$info array
return array
    protected function getMotifPath(string $cabin, array $info) : array
    {
        if (\file_exists(ROOT . '/Cabin/' . $cabin . '/config/motifs.json')) {
            $motifs = \Airship\loadJSON(ROOT . '/Cabin/' . $cabin . '/config/motifs.json');
            foreach ($motifs as $path => $motifConfig) {
                if ($motifConfig['supplier'] === $info['supplier']) {
                    if ($motifConfig['name'] === $info['name']) {
                        return [$motifConfig['path'], ROOT . '/Motifs/' . $path];
                    }
                }
            }
        }
        return [];
    }