You are here

CustomContextualLinkInterface.php in Custom Contextual Links 8.2

Namespace

Drupal\ccl\Entity

File

src/Entity/CustomContextualLinkInterface.php
View source
<?php

namespace Drupal\ccl\Entity;

use Drupal\Core\Config\Entity\ConfigEntityInterface;

/**
 * Provides an interface for defining Custom Contextual Link entities.
 */
interface CustomContextualLinkInterface extends ConfigEntityInterface {

  /**
   * Retrieve the link type of the custom contextual link.
   *
   * @return string
   *   The link type of this entity.
   */
  public function getLinkType();

  /**
   * Retrieve the advanced options for the link like query, classes, target.
   *
   * @param string $option
   *   The option key to retrieve.
   *
   * @return mixed
   *   The value of the requested option.
   */
  public function getAdvancedOption($option);

  /**
   * Retrieve the link type specific options.
   *
   * @param string $option
   *   The option key to retrieve.
   *
   * @return mixed
   *   The value of the requested option.
   */
  public function getLinkOption($option);

  /**
   * Ensures that only options according to the link type are set.
   */
  public function clearOptions();

}

Interfaces

Namesort descending Description
CustomContextualLinkInterface Provides an interface for defining Custom Contextual Link entities.