/** * @return null|string */ protected function _toHtml() { if ($this->config->isEnabled()) { return parent::_toHtml(); } return null; }
public function dispatch(RequestInterface $request) { if (!$this->session->isLoggedIn()) { return $this->_redirect('customer/account/login'); } if (!$this->config->isEnabled()) { return $this->_redirect($this->_redirect->getRefererUrl()); } return parent::dispatch($request); }
/** * @param RequestInterface $request * * @return ResponseInterface */ public function dispatch(RequestInterface $request) { if (!$this->config->isEnabled()) { $this->_redirect($this->_redirect->getRefererUrl()); } return parent::dispatch($request); }
/** * @return bool */ public function isEnabled() { return $this->config->isEnabled(); }
/** * Facebook constructor * * @param Config $config * * @throws \Facebook\Exceptions\FacebookSDKException */ public function __construct(Config $config) { if ($config->isEnabled()) { parent::__construct(['app_id' => $config->getApiKey(), 'app_secret' => $config->getApiSecret(), 'default_graph_version' => $config->getVersion()]); } }