You are here

public function Subscription::getSubscription in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/PubSubHubbub/Model/Subscription.php \Zend\Feed\PubSubHubbub\Model\Subscription::getSubscription()

Get subscription by ID/key

Parameters

string $key:

Return value

array

Throws

PubSubHubbub\Exception\InvalidArgumentException

Overrides SubscriptionPersistenceInterface::getSubscription

File

vendor/zendframework/zend-feed/src/PubSubHubbub/Model/Subscription.php, line 67

Class

Subscription

Namespace

Zend\Feed\PubSubHubbub\Model

Code

public function getSubscription($key) {
  if (empty($key) || !is_string($key)) {
    throw new PubSubHubbub\Exception\InvalidArgumentException('Invalid parameter "key"' . ' of "' . $key . '" must be a non-empty string');
  }
  $result = $this->db
    ->select([
    'id' => $key,
  ]);
  if (count($result)) {
    return $result
      ->current()
      ->getArrayCopy();
  }
  return false;
}