You are here

interface SocialNetworkInterface in Social simple 8

Same name and namespace in other branches
  1. 2.0.x src/SocialNetwork/SocialNetworkInterface.php \Drupal\social_simple\SocialNetwork\SocialNetworkInterface

Defines the interface for social network.

Allows for each social network to build its shared url, and to add additionnal options to the url built.

Hierarchy

Expanded class hierarchy of SocialNetworkInterface

All classes that implement SocialNetworkInterface

3 files declare their use of SocialNetworkInterface
SocialSimpleGenerator.php in src/SocialSimpleGenerator.php
SocialSimpleManager.php in src/SocialSimpleManager.php
SocialSimpleManagerInterface.php in src/SocialSimpleManagerInterface.php

File

src/SocialNetwork/SocialNetworkInterface.php, line 13

Namespace

Drupal\social_simple\SocialNetwork
View source
interface SocialNetworkInterface {

  /**
   * Checks whether the given transition is allowed.
   *
   * @param string $share_url
   *   The url to share.
   * @param string $title
   *   The page's title to share.
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The parent entity.
   * @param array $additional_options
   *   Additional options to pass as que query parameter to the social link.
   *
   * @return array
   *   the renderable array of the social share link.
   */
  public function getShareLink($share_url, $title = '', EntityInterface $entity = NULL, array $additional_options = []);

  /**
   * Get the network name.
   *
   * @return string
   *   the network name.
   */
  public function getLabel();

  /**
   * Get the network id.
   *
   * @return string
   *   the network id.
   */
  public function getId();

  /**
   * Get common attributes for the share link.
   *
   * @param string $network_name
   *   The social network name.
   *
   * @return array $attributes
   *   an array of link attributes.
   */
  public function getLinkAttributes($network_name);

}

Members

Namesort descending Modifiers Type Description Overrides
SocialNetworkInterface::getId public function Get the network id. 7
SocialNetworkInterface::getLabel public function Get the network name. 7
SocialNetworkInterface::getLinkAttributes public function Get common attributes for the share link. 7
SocialNetworkInterface::getShareLink public function Checks whether the given transition is allowed. 7