Skip to content

Database Collection

denisezamora edited this page Mar 28, 2019 · 17 revisions

A collection can easily be retrieved from any database table. The implementation offers support for database select queries to allow to define the query before the data is fetched.

The database model is almost fully automatic. All the columns are available in the model state and are automatically filtered on.

Defining database collections

A database collection can be defined easily by specifying the table where the collection should be retrieved from. For example:

collection:
   source: database?table=users

Where database is a shortcut for com:pages.model.database

The table parameter defines the name of the table and also accepts a table identifier.

Custom database collections

The ability to create custom collections is provided through extending the ComPagesModelDatabase class.

See: https://github.com/joomlatools/joomlatools-pages/blob/c3e516af66532aae19ab7d561aea0bea70196ab6/code/site/components/com_pages/model/database.php

Clone this wiki locally