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?

Defining Relationships

There are various types of relationship that can exist between two entities. On the pages in this section, you will find descriptions and examples of how to set up each type.

Some mapping information can be guessed by Objectiphy if you are using a sensible naming convention for your table and column names, so it is not always necessary to define every column involved in a relationship. Fully defining the mapping will improve performance a little when not using the cache (ie. during development), but makes your mapping information more verbose and ugly. If you are using column names that cannot be reliably guessed, you must define them.

The examples given on the following pages give examples showing the full mapping information as well as minimal examples where the mapping is guessed.

PreviousDoctrine MappingNextOne to one

Last updated 3 years ago

Was this helpful?