From 157e0cd36adf85b9d09b5f281b4bed3be0426079 Mon Sep 17 00:00:00 2001 From: TheCartpenter Date: Sat, 15 Jun 2024 09:39:43 -0400 Subject: [PATCH] More PHPDocs work --- upload/admin/model/catalog/attribute.php | 20 ++++++++++---------- upload/system/library/db.php | 3 ++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/upload/admin/model/catalog/attribute.php b/upload/admin/model/catalog/attribute.php index 96ad9f2c5..83ec8b24b 100644 --- a/upload/admin/model/catalog/attribute.php +++ b/upload/admin/model/catalog/attribute.php @@ -12,7 +12,7 @@ class ModelCatalogAttribute extends Model { * * @param array $data * - * @return int returns the primary key of the new attribute record + * @return int Returns the primary key of the new attribute record */ public function addAttribute(array $data): int { $this->db->query("INSERT INTO `" . DB_PREFIX . "attribute` SET `attribute_group_id` = '" . (int)$data['attribute_group_id'] . "', `sort_order` = '" . (int)$data['sort_order'] . "'"); @@ -31,8 +31,8 @@ public function addAttribute(array $data): int { * * Edit attribute record in the database. * - * @param int $attribute_id primary key of the attribute record to edit - * @param array $data array of data + * @param int $attribute_id Primary key of the attribute record to edit + * @param array $data Array of data * * @return void */ @@ -51,7 +51,7 @@ public function editAttribute(int $attribute_id, array $data): void { * * Delete attribute record in the database. * - * @param int $attribute_id primary key of the attribute record to be deleted + * @param int $attribute_id Primary key of the attribute record to be deleted * * @return void */ @@ -65,7 +65,7 @@ public function deleteAttribute(int $attribute_id): void { * * Get the record of the attribute record in the database. * - * @param int $attribute_id primary key of the attribute record to be fetched + * @param int $attribute_id Primary key of the attribute record to be fetched * * @return array */ @@ -135,9 +135,9 @@ public function getAttributes(array $data = []): array { * * Get the record of the attribute record in the database. * - * @param int $attribute_id primary key of the attribute record to be fetched + * @param int $attribute_id Primary key of the attribute record to be fetched * - * @return array> Descriptions sorted by language_id + * @return array> Returns the descriptions sorted by language_id */ public function getDescriptions(int $attribute_id): array { $attribute_data = []; @@ -156,7 +156,7 @@ public function getDescriptions(int $attribute_id): array { * * Get the total number of attribute records in the database. * - * @return int total number of attribute records + * @return int Returns the total number of attribute records */ public function getTotalAttributes(): int { $query = $this->db->query("SELECT COUNT(*) AS `total` FROM `" . DB_PREFIX . "attribute`"); @@ -169,9 +169,9 @@ public function getTotalAttributes(): int { * * Get the total number of attribute records with group ID in the database. * - * @param int $attribute_group_id foreign key of the attribute record to be fetched + * @param int $attribute_group_id Foreign key of the attribute record to be fetched * - * @return int total number of attribute records that have attribute group ID + * @return int Returns the total number of attribute records that have attribute group ID */ public function getTotalAttributesByAttributeGroupId(int $attribute_group_id): int { $query = $this->db->query("SELECT COUNT(*) AS `total` FROM `" . DB_PREFIX . "attribute` WHERE `attribute_group_id` = '" . (int)$attribute_group_id . "'"); diff --git a/upload/system/library/db.php b/upload/system/library/db.php index 96266df48..c9cf9ef5d 100644 --- a/upload/system/library/db.php +++ b/upload/system/library/db.php @@ -68,7 +68,7 @@ public function escape(string $value): string { * * Gets the total number of affected rows from the last query * - * @return int returns the total number of affected rows + * @return int Returns the total number of affected rows */ public function countAffected(): int { return $this->adaptor->countAffected(); @@ -87,6 +87,7 @@ public function getLastId(): int { /** * Is Connected + * * Checks if a DB connection is active. * * @return bool