Spiral Framework includes an ORM engine to help you manage your persistence data. ORM is capable of schema generation, multiple data carry mechanisms and support relation extensions.
Table of Contents
- Record and RecordEntity
- Repositories and Selectors
- Accessors and Filters
- Column Objects
- Scaffolding and Migrations
- Morphed Relations
- Pre-compiled Relations
- Query Models
- Eager loading
- Recursive Relations
- Hybrid Databases
- Custom Relations
ActiveRecord vs DataMapper
Spiral ORM uses features specific to both ActiveRecord and DataMapper approach, though, at this moment there is no native support to map data to pure php objects (see
Consider using Doctrine or writing your own hydration using
RecordSelector->fetchData method and existed relation loaders.
Please note, ORM engine uses second level cache/schema to store information about mapping between persistence layer and your data entity models. Do not forget to run command
spiral orm:schema -m to update the schema cache and generate migrations.
You are able to use ORM component separately from framework, take a look at initialization here.