Skip to content

Commit

Permalink
More PHPDocs work
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCartpenter committed Jun 15, 2024
1 parent 1f324b7 commit 157e0cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
20 changes: 10 additions & 10 deletions upload/admin/model/catalog/attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ModelCatalogAttribute extends Model {
*
* @param array<string, mixed> $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'] . "'");
Expand All @@ -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<string, mixed> $data array of data
* @param int $attribute_id Primary key of the attribute record to edit
* @param array<string, mixed> $data Array of data
*
* @return void
*/
Expand All @@ -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
*/
Expand All @@ -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<string, mixed>
*/
Expand Down Expand Up @@ -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<int, array<string, string>> Descriptions sorted by language_id
* @return array<int, array<string, string>> Returns the descriptions sorted by language_id
*/
public function getDescriptions(int $attribute_id): array {
$attribute_data = [];
Expand All @@ -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`");
Expand All @@ -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 . "'");
Expand Down
3 changes: 2 additions & 1 deletion upload/system/library/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -87,6 +87,7 @@ public function getLastId(): int {

/**
* Is Connected
*
* Checks if a DB connection is active.
*
* @return bool
Expand Down

0 comments on commit 157e0cd

Please sign in to comment.