You are here

protected function AvatarKitLocalCache::avatarFileName in Avatar Kit 8.2

Generate the filesystem destination for an avatar.

Parameters

string $service_id: An avatar service ID.

\Drupal\avatars\EntityAvatarIdentifierInterface $identifier: An entity avatar identifier.

Return value

string A filesystem URI.

1 call to AvatarKitLocalCache::avatarFileName()
AvatarKitLocalCache::cacheRemote in src/AvatarKitLocalCache.php
Download and save the file to an avatar cache entity.

File

src/AvatarKitLocalCache.php, line 187

Class

AvatarKitLocalCache
Cache remote files locally into file entities.

Namespace

Drupal\avatars

Code

protected function avatarFileName(string $service_id, EntityAvatarIdentifierInterface $identifier) : string {
  $name = $identifier
    ->getEntity()
    ->id();
  return \file_create_filename($name, 'public://avatar_kit/' . $service_id . '/identifier/');
}