APPNETOS is under active development This website and its documentation are being prepared for public launch. Content and features may change.
Select Theme
Loading

Collection Annotations

Document binding and database/cache controller routing.

Collection Database

Maps a Collection to its Document class and optionally selects database and cache controller implementations.

Parameter Type Default Behavior
document string Required Document class handled by this Collection.
database string|null null Optional database controller class; otherwise the default is used.
cache string|null null Optional database cache controller class; otherwise the default is used.
use Core\Collection\Annotation\Database;

#[Database(
    document: Product::class,
    database: ProductDatabase::class,
    cache: ProductDatabaseCache::class
)]
class ProductCollection extends \Core\Collection\Base {}

Relationship

The Document Database annotation points from a Document to a Collection; the Collection Database annotation points from a Collection to its Document and optionally specifies controller implementations. Both sides have distinct responsibilities.

Next Steps

Previous

Document Annotations

Explore Document Annotations

Next

Pipeline Annotations

Explore Pipeline Annotations