diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index 9acf751..49cd6e3 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -450,6 +450,9 @@ function aggregator_feed_load($fid) { * * @return * An associative array describing the category. + * + * @deprecated Use Drupal\aggregator\CategoryStorageControllerInterface::load() + * instead. */ function aggregator_category_load($cid) { $categories = &drupal_static(__FUNCTION__); diff --git a/core/modules/aggregator/lib/Drupal/aggregator/CategoryStorageController.php b/core/modules/aggregator/lib/Drupal/aggregator/CategoryStorageController.php index 8814321..77e978d 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/CategoryStorageController.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/CategoryStorageController.php @@ -8,9 +8,6 @@ namespace Drupal\aggregator; use Drupal\Core\Database\Connection; -use Drupal\Core\Entity\EntityManager; -use Drupal\Core\Entity\EntityStorageControllerInterface; -use Drupal\Core\Extension\ModuleHandlerInterface; /** * Storage controller for aggregator categories. @@ -27,7 +24,7 @@ class CategoryStorageController implements CategoryStorageControllerInterface { /** * Creates a new CategoryStorageController object. * - * @param Connection $database + * @param \Drupal\Core\Database\Connection $database * The database connection. */ public function __construct(Connection $database) { @@ -38,7 +35,7 @@ public function __construct(Connection $database) { * {@inheritdoc} */ public function load($cid) { - return $this->database->query("SELECT cid, title, description, block FROM {aggregator_category} WHERE cid = :cid", array(':cid' => $cid))->fetchAssoc(); + return $this->database->query("SELECT * FROM {aggregator_category} WHERE cid = :cid", array(':cid' => $cid))->fetchObject(); } /** diff --git a/core/modules/aggregator/lib/Drupal/aggregator/CategoryStorageControllerInterface.php b/core/modules/aggregator/lib/Drupal/aggregator/CategoryStorageControllerInterface.php index 3d829ac..c3e9e0a 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/CategoryStorageControllerInterface.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/CategoryStorageControllerInterface.php @@ -18,7 +18,7 @@ * @param int $cid * The unique category ID. * - * @return array|null + * @return stdClass|null * An array of category properties. */ public function load($cid); @@ -65,5 +65,6 @@ public function delete($cid); * TRUE if the category title is unique, FALSE otherwise. */ public function isUnique($title, $cid = NULL); + } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Form/CategoryAdminForm.php b/core/modules/aggregator/lib/Drupal/aggregator/Form/CategoryAdminForm.php index 4be0b2d..219e17f 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Form/CategoryAdminForm.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Form/CategoryAdminForm.php @@ -104,7 +104,7 @@ public function getFormID() { */ public function buildForm(array $form, array &$form_state, $cid = NULL, Request $request = NULL) { $this->request = $request; - $category = (object) $this->categoryStorageController->load($cid); + $category = $this->categoryStorageController->load($cid); $form['title'] = array( '#type' => 'textfield', '#title' => t('Title'), diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Form/CategoryDeleteForm.php b/core/modules/aggregator/lib/Drupal/aggregator/Form/CategoryDeleteForm.php index 474e499..c057bd1 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Form/CategoryDeleteForm.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Form/CategoryDeleteForm.php @@ -136,7 +136,7 @@ public function getDescription() { * If the cid param or category is not found. */ public function buildForm(array $form, array &$form_state, Request $request = NULL, $cid = NULL) { - $category = (object) $this->categoryStorageController->load($cid); + $category = $this->categoryStorageController->load($cid); if (empty($cid) || empty($category)) { throw new NotFoundHttpException(); }