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.
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 RecordInterface
).
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.