You are here

ClientFactory.php in Lockr 8.2

Namespace

Drupal\lockr

File

src/ClientFactory.php
View source
<?php

namespace Drupal\lockr;

use Lockr\KeyClient;
use Lockr\Lockr;
use Lockr\SiteClient;

/**
 * Creates various Lockr clients.
 */
class ClientFactory {

  /** @var \Lockr\Lockr */
  protected $client;

  /**
   * Construct a new client factory.
   *
   * @param \Lockr\Lockr $client
   */
  public function __construct(Lockr $client) {
    $this->client = $client;
  }

  /**
   * Get a site Lockr client.
   *
   * @return \Lockr\SiteClient
   */
  public function getSiteClient() {
    return new SiteClient($this->client);
  }

  /**
   * Get a key Lockr client.
   *
   * @return \Lockr\KeyClient
   */
  public function getKeyClient() {
    return new KeyClient($this->client);
  }

}

Classes

Namesort descending Description
ClientFactory Creates various Lockr clients.