Puli\Repository\JsonRepository::prependOrderEntry PHP Метод

prependOrderEntry() приватный Метод

Inserts a path at the beginning of the order list of a mapped path.
private prependOrderEntry ( string $path, string $prependedPath )
$path string The path of the mapping where to prepend.
$prependedPath string The path of the mapping to prepend.
    private function prependOrderEntry($path, $prependedPath)
    {
        $lastEntry = reset($this->json['_order'][$path]);
        if ($prependedPath === $lastEntry['path']) {
            // If the first entry matches the new one, add the reference
            // of the current resource to the limit
            ++$lastEntry['references'];
        } else {
            array_unshift($this->json['_order'][$path], array('path' => $prependedPath, 'references' => 1));
        }
    }