You are here

public function SocialSimpleManager::addNetwork in Social simple 2.0.x

Same name and namespace in other branches
  1. 8 src/SocialSimpleManager.php \Drupal\social_simple\SocialSimpleManager::addNetwork()

Adds another social network builder.

Parameters

\Drupal\social_simple\SocialNetwork\SocialNetworkInterface $network: The social network builder to add.

int $priority: Priority of the social network builder.

Overrides SocialSimpleManagerInterface::addNetwork

File

src/SocialSimpleManager.php, line 56

Class

SocialSimpleManager
Provides a social network manager.

Namespace

Drupal\social_simple

Code

public function addNetwork(SocialNetworkInterface $network, $priority) {
  $network_id = $network
    ->getId();
  $this->networks[$network_id][$priority][] = $network;

  // Force the builders to be re-sorted.
  $this->sortedNetworks = NULL;
}