protected function findActiveVersionByLocator(LocatorInterface $locator)
    {
        $criteria = new Criteria();
        $criteria->where(
            $criteria->expr()->in(
                'status',
                [VersionStatuses::PUBLISHED, VersionStatuses::DEPUBLISHED]
            )
        );
        foreach ($locator->toArray() as $column => $value) {
            $criteria->andWhere($criteria->expr()->eq($column, $value));
        }
        $criteria->orderBy(['id' => Criteria::DESC]);
        $criteria->setMaxResults(1);

        $entities = $this->entityManger->getRepository($this->entityClassName)->matching($criteria)->toArray();

        if (isset($entities[0])) {
            return $entities[0];
        }

        return null;
    }