Objectiphy
  • Introduction
  • Quick Start
  • Basic Fetching
  • Basic Saving
  • Deleting
  • Mapping Providers
    • Attributes
    • Objectiphy Mapping
    • Doctrine Mapping
  • Defining Relationships
    • One to one
    • One to Many
    • Many to one
    • Many to Many
    • Scalar Joins
  • Query Builder
    • Running a Query
    • Select Queries
    • Update Queries
    • Insert Queries
    • Delete Queries
    • Criteria
      • Operators
      • Filtering by Child Objects
      • Filtering by Aggregates
    • Joins
  • Pagination and Sorting
  • Embedded Value Objects
  • Serialization Groups
  • Late Binding and Lazy Loading
  • Streaming Results
  • Custom Repositories
  • Optimisation
  • Configuration Options
  • Mapping Overrides
  • Caching
  • Comparison with Doctrine
  • Code Generation etc.
  • Troubleshooting
  • Licence, Copyright, Credits
Powered by GitBook
On this page

Was this helpful?

Mapping Providers

Objectiphy comes with a mapping provider for PHP attributes (requires PHP 8 or above), or annotations, but if you want to store your mapping information some other way, you could write your own class that implements MappingProviderInterface, and call setMappingProvider on the factory before creating your repository. Your custom class would have to convert your mapping information from whatever format it is stored in, to Table, Relationship, and Column objects.

Objectiphy has its own annotations, but it can also use Doctrine attributes or annotations. This allows us to re-use entities that were written for Doctrine, but amend the mapping information for use with Objectiphy if required, without breaking any existing code that uses Doctrine. Objectiphy will first look for Doctrine annotations, and then override those values with the ones from any Objectiphy annotations or PHP attributes. Not all Doctrine values are recognised by Objectiphy however.

PreviousDeletingNextAttributes

Last updated 2 years ago

Was this helpful?