You are here

class EntityPagePreview in Real-time SEO for Drupal 8.2

A class to encapsulate entity analysis results.

Hierarchy

Expanded class hierarchy of EntityPagePreview

File

src/Entity/EntityPagePreview.php, line 10

Namespace

Drupal\yoast_seo\Entity
View source
class EntityPagePreview implements EntityPreviewInterface {

  /**
   * The entity being previewed.
   *
   * @var \Drupal\Core\Entity\EntityInterface
   */
  protected $entity;

  /**
   * The language the preview is in.
   *
   * @var \Drupal\Core\Language\LanguageInterface
   */
  protected $language;

  /**
   * {@inheritdoc}
   */
  public function __construct(EntityInterface $entity) {
    $this->entity = $entity;
    $this->language = $entity
      ->language();
  }

  /**
   * {@inheritdoc}
   */
  public function language() {
    return $this->language;
  }

  /**
   * {@inheritdoc}
   */
  public function getEntity() {
    return $this->entity;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityPagePreview::$entity protected property The entity being previewed.
EntityPagePreview::$language protected property The language the preview is in.
EntityPagePreview::getEntity public function Gets the entity that this is a preview for. Overrides EntityPreviewInterface::getEntity
EntityPagePreview::language public function Retrieves the language of the preview. Overrides EntityPreviewInterface::language
EntityPagePreview::__construct public function