public function read(Repository $repository, $id)
    {
        $search = $repository->createSearch();
        $search->addQuery(new IdsQuery([$id]));
        $search->setSize(1);

        $results = $repository->execute($search, Result::RESULTS_ARRAY);

        if (!isset($results[0])) {
            return null;
        }

        return $results[0];
    }
public function read(Repository $repository, $id)
    {
        $search = $repository->createSearch();
        $search->addQuery(new IdsQuery([$id]));
        $search->setSize(1);

        $results = $repository->execute($search, Result::RESULTS_ARRAY);

        if (!isset($results[0])) {
            return null;
        }

        return $results[0];
    }
{@inheritdoc}