You are here

private function CarouselItem::getValue in bootstrap simple carousel 8

Return an entity value by name.

8 calls to CarouselItem::getValue()
CarouselItem::getCaptionText in src/Entity/CarouselItem.php
Return caption text.
CarouselItem::getCaptionTitle in src/Entity/CarouselItem.php
Return caption title.
CarouselItem::getImageAlt in src/Entity/CarouselItem.php
Return image alt.
CarouselItem::getImageId in src/Entity/CarouselItem.php
Return image id.
CarouselItem::getImageLink in src/Entity/CarouselItem.php
Return image link.

... See full list

File

src/Entity/CarouselItem.php, line 56

Class

CarouselItem
Defines the carousel item entity class.

Namespace

Drupal\bootstrap_simple_carousel\Entity

Code

private function getValue($field_name) {
  if (!isset($this->values[$field_name][$this->activeLangcode])) {
    $list = $this
      ->getTranslatedField($field_name, $this->activeLangcode)
      ->first();
    return NULL !== $list ? $list
      ->getString() : NULL;
  }
  return $this->values[$field_name][$this->activeLangcode] ?? NULL;
}