Let's say I have object A.
/**
* @Table(name="a")
* repo class definition annotation here
**/
class A {
/**
* @Column(name="id")
* ... etc
**/
private $id;
/**
* this is pulled from another table. It is not an entity, just a decimal value
*/
private $otherThingFromAnotherTable;
}
How can I pull $otherThingFromAnotherTable
from table other_table
using ORM annotations? It's not an entity, it's just a decimal value.
I've got the following annotations, so far:
* @ORM\OneToOne(targetEntity="??")
* @ORM\JoinTable(name="other_table",
* joinColumns={
* @ORM\JoinColumn(name="offer_id", referencedColumnName="id")
* }
* )
Currently, I am just using raw queries in the repo class so I can use it through the entity manager. Unfortunately, that only returns an array, not the object. I'd like to be able to use just $this->em->repo->find($id)
and have it pull everything automatically instead of a custom method.