commit 576ab46dda397f5ebc311f912197f35cb77bd815 Author: John Choque Date: Thu Jan 7 09:43:09 2016 +0100 Added correct indentation diff --git a/src/Subscription/SubscriptionStorage.php b/src/Subscription/SubscriptionStorage.php index 22e7955..951992f 100644 --- a/src/Subscription/SubscriptionStorage.php +++ b/src/Subscription/SubscriptionStorage.php @@ -6,7 +6,6 @@ namespace Drupal\simplenews\Subscription; - use Drupal\Core\Entity\Sql\SqlContentEntityStorage; /** @@ -14,19 +13,20 @@ use Drupal\Core\Entity\Sql\SqlContentEntityStorage; */ class SubscriptionStorage extends SqlContentEntityStorage implements SubscriptionStorageInterface { - /** - * {@inheritdoc} - */ - public function deleteSubscriptions($conditions = array()) { - if (!db_table_exists('simplenews_subscriber__subscriptions')) { - // This can happen if this is called during uninstall. - return; - } - $query = $this->database->delete('simplenews_subscriber__subscriptions'); - foreach ($conditions as $key => $condition) { - $query->condition($key, $condition); - } - $query->execute(); - $this->resetCache(); + /** + * {@inheritdoc} + */ + public function deleteSubscriptions($conditions = array()) { + $table_name = $this->getTableMapping()->getTableName('subscriptions'); + if (!$table_name) { + // This can happen if this is called during uninstall. + return; + } + $query = $this->database->delete($table_name); + foreach ($conditions as $key => $condition) { + $query->condition($key, $condition); } -} \ No newline at end of file + $query->execute(); + $this->resetCache(); + } +} diff --git a/src/Subscription/SubscriptionStorageInterface.php b/src/Subscription/SubscriptionStorageInterface.php index d69a0bb..32f50ea 100644 --- a/src/Subscription/SubscriptionStorageInterface.php +++ b/src/Subscription/SubscriptionStorageInterface.php @@ -7,18 +7,19 @@ namespace Drupal\simplenews\Subscription; /** - * Subscription storage + * Subscription storage. */ interface SubscriptionStorageInterface { - /** - * Delete subscriptions. - * - * @param array $conditions - * An associative array of conditions matching the records to be delete. - * Example: array('newsletter_id' => 5, 'snid' => 12) - * Delete the subscription of subscriber 12 to newsletter newsletter_id 5. - * - * @ingroup subscription - */ - public function deleteSubscriptions($conditions = array()); + + /** + * Deletes subscriptions. + * + * @param array $conditions + * An associative array of conditions matching the records to be delete. + * Example: array('newsletter_id' => 5, 'snid' => 12) + * Delete the subscription of subscriber 12 to newsletter newsletter_id 5. + * + * @ingroup subscription + */ + public function deleteSubscriptions($conditions = array()); }