public function BrightcoveSubscriptionController::createSubscription in Brightcove Video Connect 8
Same name and namespace in other branches
- 8.2 src/Controller/BrightcoveSubscriptionController.php \Drupal\brightcove\Controller\BrightcoveSubscriptionController::createSubscription()
- 3.x src/Controller/BrightcoveSubscriptionController.php \Drupal\brightcove\Controller\BrightcoveSubscriptionController::createSubscription()
Create a subscription on Brightcove from an already existing entity.
Parameters
int $id: BrightcoveSubscription entity ID.
Return value
\Symfony\Component\HttpFoundation\RedirectResponse Redirect response to redirect user after creating a Drupal only subscription.
1 string reference to 'BrightcoveSubscriptionController::createSubscription'
File
- src/
Controller/ BrightcoveSubscriptionController.php, line 261
Class
- BrightcoveSubscriptionController
- Provides controller for subscription related callbacks.
Namespace
Drupal\brightcove\ControllerCode
public function createSubscription($id) {
try {
$brightcove_subscription = BrightcoveSubscription::load($id);
$brightcove_subscription
->saveToBrightcove();
} catch (BrightcoveSubscriptionException $e) {
drupal_set_message($this
->t('Failed to create Subscription on Brightcove: @error', [
'@error' => $e
->getMessage(),
]), 'error');
}
return $this
->redirect('entity.brightcove_subscription.list');
}