Skip to content

docs: fix singular table names in API guide's withAuthorInfo() method#10058

Open
AlexRasch wants to merge 1 commit intocodeigniter4:developfrom
AlexRasch:patch-1
Open

docs: fix singular table names in API guide's withAuthorInfo() method#10058
AlexRasch wants to merge 1 commit intocodeigniter4:developfrom
AlexRasch:patch-1

Conversation

@AlexRasch
Copy link

Description
The BookModel::withAuthorInfo() method in the Controller guide uses singular table names (book, author) instead of the plural names (books, authors) created in the Database Setup migration. This updates the method to use the correct plural table names for consistency across the API guide.

Fixes #10057

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

The `BookModel::withAuthorInfo()` method in the Controller guide uses singular table names (book, author) instead of the plural names (books, authors) created in the Database Setup migration.

Fixes codeigniter4#10057
@mergeable
Copy link

mergeable bot commented Mar 21, 2026

Hi there, AlexRasch! 👋

Thank you for sending this PR!

We expect the following in all Pull Requests (PRs).

Important

We expect all code changes or bug-fixes to be accompanied by one or more tests added to our test suite to prove the code works.

If pull requests do not comply with the above, they will likely be closed. Since we are a team of volunteers, we don't have any more time to work
on the framework than you do. Please make it as painless for your contributions to be included as possible.

See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md

Sincerely, the mergeable bot 🤖

@michalsn
Copy link
Member

@AlexRasch Please run composer cs-fix and send the updated code.

@neznaika0
Copy link
Contributor

We talked about it. Many people refer to tables in the singular. For the API too. In the framework, it is usually in the plural, so there were disagreements.

@michalsn
Copy link
Member

The fix is valid. Since the tables were created using plural names, we should refer to them accordingly. This is part of the same guide. See the linked issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation inconsistency: singular vs plural table names in API guide

3 participants