Neos\Media\Domain\Service\AssetService::getRepository PHP Method

getRepository() public method

Returns the repository for an asset
public getRepository ( Neos\Media\Domain\Model\AssetInterface $asset ) : Neos\Flow\Persistence\RepositoryInterface
$asset Neos\Media\Domain\Model\AssetInterface
return Neos\Flow\Persistence\RepositoryInterface
    public function getRepository(AssetInterface $asset)
    {
        $assetRepositoryClassName = str_replace('\\Model\\', '\\Repository\\', get_class($asset)) . 'Repository';
        if (class_exists($assetRepositoryClassName)) {
            return $this->objectManager->get($assetRepositoryClassName);
        }
        return $this->objectManager->get(AssetRepository::class);
    }