Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Persistence in PHP with Doctrine ORM

You're reading from  Persistence in PHP with Doctrine ORM

Product type Book
Published in Dec 2013
Publisher Packt
ISBN-13 9781782164104
Pages 114 pages
Edition 1st Edition
Languages
Author (1):
Kevin Dunglas Kevin Dunglas
Author Profile Icon Kevin Dunglas
Kevin Dunglas
Toc

Getting started with the Doctrine associations


We will specify Doctrine associations, such as other mapping information, using annotations (other methods such as XML and YAML configuration files are also supported. See Chapter 2, Entities and Mapping Information). Doctrine supports the following association types:

  • One-To-One: One entity is linked to one entity

  • Many-To-One: Several entities are linked to one entity (only available for bidirectional associations and always the inverse side of a One-To-Many association)

  • One-To-Many: One entity is linked to several entities

  • Many-To-Many: Several entities are linked to several entities

An association can be unidirectional or bidirectional. Unidirectional associations only have an owning side while bidirectional associations have both an owning side and an inverse side. In other words they can be explained as follows:

  • A unidirectional association can be used in only one way: related entities are retrievable from the main entities. For example, a...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime