last day (14 days later) » 

11:45 AM
1
A: Symfony custom repository query giving error

DonCallistoSELECT * doesn't mean anything but a syntax error for Doctrine. If you want to select your entity, just write SELECT u FROM UserBundle:User u where e is an "alias" for your entity Of course you need to integrate it with the rest of your query SELECT u FROM UserBundle:User u LEFT JOIN u.appl...

 
and the rest of the query should remain as it is?
 
@Saadia: I've reported in my answer. Just try or paste entities classes that are involved into this query as, without any other details, I can't help you.
 
I have updated my question with Entity names and their relations, i hope that helps or you want me to paste entire entities?
 
@Saadia: I need the names of the fields of every entity (or, at least, the names of fields that could help me in joins, so associations fields)
 
I have already mentioned that in my question under the update section
 
11:45 AM
@Saadia: I need the "inversed" one. I mean, I need to know how you retrieve an apply from user, not vice-versa
here we are
 
HI
I will share my yml files so you can see how they are linked
 
This is my User.orm.yml

Acme\UserBundle\Entity\User:
type: entity
table: pe_users
id:
id:
type: integer
id: true
generator:
strategy: AUTO
fields:
username:
type: string
length: 255
password:
type: string
length: 255
salt:
type: string
length: 255
nullable: true
first_name:
type: string
length: 255
last_name:
type: string
length: 255
email:
type: string
length: 255
unique: true
isActive:
type: boolean
role:
type: string
length: 255
mobile:
type: integer
code:
type: string
length: 20
nullable: true
 
so, just to be clear, you haven't an attribute to retrieve, from a user, one (or more, I don't know) apply(applies)?
is that right
?
 
not sure if i understand your question
let me explain
1 user can apply for many applications and 1 application can have many offer
 
11:51 AM
yeah ok, apart that
I mean
with doctrine, you could retrieve "automatically" an entity (record) that is related to one entiy
*entity
 
yes
 
for instance
ok
so, you have a monodirectional relationship
between user and apply
and you could only retrieve "automatically" (by attribute) users from apply
am I right
?
 
if monodirectional means OnetoMany relationship then yes
 
no
monodirectional means that you can retrieve only one side of the relationship
from the other
 
yes
you are correct thats the way it is
 
11:54 AM
ok
So this changes my answer
 
ok
Are you going to let me know that here?
 
no, I will update my answer and comment
 
ok thanks
 
12:15 PM
is there an easier way to achieve this using doctrine?
rather than raw sql
 

last day (14 days later) »