Skip to content

Document opt-in model table resolution from Source attributes - #351

Open
QUAD69 wants to merge 7 commits into
phalcon:masterfrom
QUAD69:docs-source-attribute
Open

QUAD69 wants to merge 7 commits into
phalcon:masterfrom
QUAD69:docs-source-attribute

Conversation

@QUAD69

@QUAD69 QUAD69 commented Nov 8, 2026 •

Copy link
Copy Markdown

Document opt-in ORM table resolution from #[Source] in the Phalcon 5.24 guides, matching phalcon/cphalcon#17742 and its review request: phalcon/cphalcon#17742 (comment).

The model guide shows how to select AttributesReader before using Source, explains named and positional arguments, explicit-source precedence, table prefixes, per-class caching, inheritance, and compatibility with the configured metadata strategy. It also documents fallback for foreign annotations services and Mvc\Model\Exception for missing, empty, whitespace-only, or non-string table names, with diagnostic values or types in the message and InvalidSourceTable retained as previous. The annotations guide links to this section; PHPDoc @Source remains ignored for table resolution.

Both guides explain the per-request Reflection cost of Memory and recommend Apcu or Stream for persistent caching, including cache invalidation after attribute changes. The APCu example clears any already resolved shared adapter before registering its replacement. The model guide explains that source resolution and the Annotations metadata strategy reuse the same parsed data.

The availability note states that Phalcon 5.23.0 lacks this behavior and requires a release containing the framework fix. The framework PR is still under review. The new guidance lives in the upcoming 5.24 documentation; the released 5.23 guides retain their existing behavior.

Related: phalcon/cphalcon#17741, phalcon/cphalcon#17742.

Validation after merging upstream master at 07181c4:

  • Both changed pages compile with @mdx-js/mdx.
  • pnpm lint:docs passes: 3153 files lint clean.
  • The exact APCu snippet from the page runs against the patched extension with both a fresh container and an already resolved Memory adapter. Previous cold and warm cache checks pass for both Apcu and Stream.
  • git diff --check passes.

The final diff against master changes only docs-5.24/annotations.mdx and docs-5.24/db-models.mdx; generated API pages, routes and released-version manuals are unchanged.

The previous full site build passed (3152 pages); this content-only follow-up was checked with the documentation linter and direct MDX compilation.

Describe reader configuration, source precedence, prefixes and inheritance
for the model table resolution fix in phalcon/cphalcon#17742. Link the
annotations guide to the model guide and state the release requirement.

Assisted-by: Codex
Explain that missing, empty and non-string Source table names raise
InvalidSourceTable during source resolution, matching phalcon/cphalcon#17742.

Assisted-by: Codex
Bring in the upstream 5.24 documentation tree before moving the pending
Source integration guide to the upcoming release.

Assisted-by: Codex
Move the model Source attribute guide and annotations cross-reference to
the newly available 5.24 documentation. Restore the released 5.23 guides
and retain the availability note linking the unreleased framework fix.

Assisted-by: Codex
Document foreign-service fallback, ORM exception chaining, whitespace validation and the per-request reflection cost of Memory with AttributesReader.

Assisted-by: Codex
Clarify safe diagnostics for invalid compound Source arguments.

Assisted-by: Codex

This branch has not been deployed

No deployments
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.

1 participant