You are here

public static function Font::loadByUrl in @font-your-face 8.3

Returns font by url.

Parameters

string $font_url: $The unique font url.

Return value

array Array of fonts.

Overrides FontInterface::loadByUrl

4 calls to Font::loadByUrl()
Font::loadActivatedFonts in src/Entity/Font.php
Returns list of enabled fonts.
FontDisplay::getFont in src/Entity/FontDisplay.php
Gets the Font.
fontyourface_save_font in ./fontyourface.module
Saves/updates font.
LocalFontConfigEntityListBuilder::buildRow in modules/local_fonts/src/LocalFontConfigEntityListBuilder.php
Builds a row for an entity in the entity listing.

File

src/Entity/Font.php, line 181

Class

Font
Defines the Font entity.

Namespace

Drupal\fontyourface\Entity

Code

public static function loadByUrl($font_url) {
  $fonts = \Drupal::entityTypeManager()
    ->getStorage('font')
    ->loadByProperties([
    'url' => $font_url,
  ]);
  return reset($fonts);
}