Model and databases#
In Silverstripe CMS, application data is typically represented by DataObject
models. A DataObject
subclass defines the
data columns, relationships and properties of a particular data record. For example, Member
is a DataObject
which stores information about a person who has authenticated access to your project.
Introduction to the Data Model and ORM
Introduction to creating and querying a database records through the ORM (object-relational mapping)
Relations between Records
Relate models together using the ORM using has_one, has_many, and many_many.
Managing Lists
The SS_List interface allows you to iterate through and manipulate a list of objects.
Data types, Overriding and Casting
Learn how data is stored going in and coming out of the ORM and how to modify it.
Extending DataObjects
Modify the data model without using subclasses.
SearchFilter Modifiers
Use suffixes on your ORM queries.
Model-Level Permissions
Reduce risk by securing models.
SQL Queries
Write and modify direct database queries through SQLExpression subclasses.
Model Validation and Constraints
Validate your data at the model level
Versioning
Add versioning to your database content through the Versioned extension.
Building Model and Search Interfaces around Scaffolding
A Model-driven approach to defining your application UI.
Indexes
Add Indexes to your Data Model to optimize database queries.
Managing Records
Manage your DataObject records
How to's#
Dynamic Default Fields
Learn how to add default values to your models
Grouping DataObject sets
Learn how to split the results of a query into subgroups