예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function resetConfig()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'resetConfig');
     if (!$pluginInfo) {
         return parent::resetConfig();
     } else {
         return $this->___callPlugins('resetConfig', func_get_args(), $pluginInfo);
     }
 }
예제 #2
0
 /**
  * Removes an account with associated api tokens for the store.
  *
  * @param \NostoAccount $account the account to remove.
  * @param Store $store the store.
  *
  * @return bool true on success, false otherwise.
  */
 public function deleteAccount(\NostoAccount $account, Store $store)
 {
     if ((int) $store->getId() < 1) {
         return false;
     }
     $this->_config->delete(self::XML_PATH_ACCOUNT, ScopeInterface::SCOPE_STORES, $store->getId());
     $this->_config->delete(self::XML_PATH_TOKENS, ScopeInterface::SCOPE_STORES, $store->getId());
     try {
         // Notify Nosto that the account was deleted.
         $service = new \NostoServiceAccount();
         $service->delete($account);
     } catch (\NostoException $e) {
         // Failures are logged but not shown to the user.
         $this->_logger->error($e, ['exception' => $e]);
     }
     $store->resetConfig();
     return true;
 }