In the schema, there's no relation between news and car, because I
want to use news for other object (like moto for exemple), and I'm not
that good to create a behavior.
Here's the error :
"Car" with an alias of "Car" in your query does not reference the
parent component it is related to.
You shouldn't need a relation to do a "from with commas" implicit join
like this one. Your code would work just the way you wrote it. Except
that in your schema, cars is plural, and in your code it is singular.
You should change cars to Car in your schema.yml.
You should also be consistent about your capitalization although that
might not be a dealbreaker.
> In the schema, there's no relation between news and car, because I
> want to use news for other object (like moto for exemple), and I'm not
> that good to create a behavior.
> Here's the error :
> "Car" with an alias of "Car" in your query does not reference the
> parent component it is related to.
> If anyone can help... ?
> thanks in advance to everyone.
> πR
-- Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com
> You shouldn't need a relation to do a "from with commas" implicit join
> like this one. Your code would work just the way you wrote it. Except
> that in your schema, cars is plural, and in your code it is singular.
> You should change cars to Car in your schema.yml.
> You should also be consistent about your capitalization although that
> might not be a dealbreaker.
> > In the schema, there's no relation between news and car, because I
> > want to use news for other object (like moto for exemple), and I'm not
> > that good to create a behavior.
> > Here's the error :
> > "Car" with an alias of "Car" in your query does not reference the
> > parent component it is related to.
> You shouldn't need a relation to do a "from with commas" implicit join
> like this one. Your code would work just the way you wrote it. Except
> that in your schema, cars is plural, and in your code it is singular.
> You should change cars to Car in your schema.yml.
> You should also be consistent about your capitalization although that
> might not be a dealbreaker.
> > In the schema, there's no relation between news and car, because I
> > want to use news for other object (like moto for exemple), and I'm not
> > that good to create a behavior.
> > Here's the error :
> > "Car" with an alias of "Car" in your query does not reference the
> > parent component it is related to.
> Thanks for you answer, but it didn't change anything, I still have the
> same error.
> eXtreme, you said "in DQL you should", should what ? need an explicit
> relation in the schema ?
> πR
> On 8 juil, 03:03, Tom Boutell <t...@punkave.com> wrote:
> > You shouldn't need a relation to do a "from with commas" implicit join
> > like this one. Your code would work just the way you wrote it. Except
> > that in your schema, cars is plural, and in your code it is singular.
> > You should change cars to Car in your schema.yml.
> > You should also be consistent about your capitalization although that
> > might not be a dealbreaker.
> > > In the schema, there's no relation between news and car, because I
> > > want to use news for other object (like moto for exemple), and I'm not
> > > that good to create a behavior.
> > > Here's the error :
> > > "Car" with an alias of "Car" in your query does not reference the
> > > parent component it is related to.
So you mean I have to declare all the relations in the schema.yml ?
For every object I want to be related with an other ?
I can't do more general with object_id and object fields ?
Thanks for your answer
πR
On 8 juil, 16:04, eXtreme <jacek.jedrzejew...@gmail.com> wrote:
> Yes you need a relation, in DQL comma separated "FROM Table t,
> t.Relation r" means the same as "FROM Table t LEFT JOIN t.Relation r"
> On 8 Lip, 11:24, Chtipepere <chtipep...@gmail.com> wrote:
> > Thanks for you answer, but it didn't change anything, I still have the
> > same error.
> > eXtreme, you said "in DQL you should", should what ? need an explicit
> > relation in the schema ?
> > πR
> > On 8 juil, 03:03, Tom Boutell <t...@punkave.com> wrote:
> > > You shouldn't need a relation to do a "from with commas" implicit join
> > > like this one. Your code would work just the way you wrote it. Except
> > > that in your schema, cars is plural, and in your code it is singular.
> > > You should change cars to Car in your schema.yml.
> > > You should also be consistent about your capitalization although that
> > > might not be a dealbreaker.
> > > > In the schema, there's no relation between news and car, because I
> > > > want to use news for other object (like moto for exemple), and I'm not
> > > > that good to create a behavior.
> > > > Here's the error :
> > > > "Car" with an alias of "Car" in your query does not reference the
> > > > parent component it is related to.
You can create a model "TypeObject" or something like this, then
create other models (like Cars, Buses, Trains whatever :P) inheriting
that TypeObject and create a relation only between TypeObject and
News. A query:
"FROM News n, n.Objects o"
will contain a news and all those extending objects (and its classes).
On 8 Lip, 18:09, Chtipepere <chtipep...@gmail.com> wrote:
> So you mean I have to declare all the relations in the schema.yml ?
> For every object I want to be related with an other ?
> I can't do more general with object_id and object fields ?
> Thanks for your answer
> πR
> On 8 juil, 16:04, eXtreme <jacek.jedrzejew...@gmail.com> wrote:
> > Yes you need a relation, in DQL comma separated "FROM Table t,
> > t.Relation r" means the same as "FROM Table t LEFT JOIN t.Relation r"
> > On 8 Lip, 11:24, Chtipepere <chtipep...@gmail.com> wrote:
> > > Thanks for you answer, but it didn't change anything, I still have the
> > > same error.
> > > eXtreme, you said "in DQL you should", should what ? need an explicit
> > > relation in the schema ?
> > > πR
> > > On 8 juil, 03:03, Tom Boutell <t...@punkave.com> wrote:
> > > > You shouldn't need a relation to do a "from with commas" implicit join
> > > > like this one. Your code would work just the way you wrote it. Except
> > > > that in your schema, cars is plural, and in your code it is singular.
> > > > You should change cars to Car in your schema.yml.
> > > > You should also be consistent about your capitalization although that
> > > > might not be a dealbreaker.
> > > > > In the schema, there's no relation between news and car, because I
> > > > > want to use news for other object (like moto for exemple), and I'm not
> > > > > that good to create a behavior.
> > > > > Here's the error :
> > > > > "Car" with an alias of "Car" in your query does not reference the
> > > > > parent component it is related to.
But, I think I can't have other fields in Car...
In your solution, I have to define TypeObject with all the fields that
Car, Bus and Moto should contain
e.g. for a car, we want to know if it's a cab or not, for a bus we
want to know how many people can seat in, etc...
So TypeObject should contain all these fields, because it's a generic
object. Am I right ?
If so, I'm not sure it's the right solution for my problem...
On 8 juil, 19:21, eXtreme <jacek.jedrzejew...@gmail.com> wrote:
> Yes, all relations in Doctrine have to be declared.
> But there is a different solution for this. :P You can use table
> column aggregation inheritance:http://preview.tinyurl.com/m4fjdo
> You can create a model "TypeObject" or something like this, then
> create other models (like Cars, Buses, Trains whatever :P) inheriting
> that TypeObject and create a relation only between TypeObject and
> News. A query:
> "FROM News n, n.Objects o"
> will contain a news and all those extending objects (and its classes).
> On 8 Lip, 18:09, Chtipepere <chtipep...@gmail.com> wrote:
> > So you mean I have to declare all the relations in the schema.yml ?
> > For every object I want to be related with an other ?
> > I can't do more general with object_id and object fields ?
> > Thanks for your answer
> > πR
> > On 8 juil, 16:04, eXtreme <jacek.jedrzejew...@gmail.com> wrote:
> > > Yes you need a relation, in DQL comma separated "FROM Table t,
> > > t.Relation r" means the same as "FROM Table t LEFT JOIN t.Relation r"
> > > On 8 Lip, 11:24, Chtipepere <chtipep...@gmail.com> wrote:
> > > > Thanks for you answer, but it didn't change anything, I still have the
> > > > same error.
> > > > eXtreme, you said "in DQL you should", should what ? need an explicit
> > > > relation in the schema ?
> > > > πR
> > > > On 8 juil, 03:03, Tom Boutell <t...@punkave.com> wrote:
> > > > > You shouldn't need a relation to do a "from with commas" implicit join
> > > > > like this one. Your code would work just the way you wrote it. Except
> > > > > that in your schema, cars is plural, and in your code it is singular.
> > > > > You should change cars to Car in your schema.yml.
> > > > > You should also be consistent about your capitalization although that
> > > > > might not be a dealbreaker.
> > > > > > In the schema, there's no relation between news and car, because I
> > > > > > want to use news for other object (like moto for exemple), and I'm not
> > > > > > that good to create a behavior.
> > > > > > Here's the error :
> > > > > > "Car" with an alias of "Car" in your query does not reference the
> > > > > > parent component it is related to.
> But, I think I can't have other fields in Car...
> In your solution, I have to define TypeObject with all the fields that
> Car, Bus and Moto should contain
> e.g. for a car, we want to know if it's a cab or not, for a bus we
> want to know how many people can seat in, etc...
> So TypeObject should contain all these fields, because it's a generic
> object. Am I right ?
> If so, I'm not sure it's the right solution for my problem...
> On 8 juil, 19:21, eXtreme <jacek.jedrzejew...@gmail.com> wrote:
> > Yes, all relations in Doctrine have to be declared.
> > But there is a different solution for this. :P You can use table
> > column aggregation inheritance:http://preview.tinyurl.com/m4fjdo
> > You can create a model "TypeObject" or something like this, then
> > create other models (like Cars, Buses, Trains whatever :P) inheriting
> > that TypeObject and create a relation only between TypeObject and
> > News. A query:
> > "FROM News n, n.Objects o"
> > will contain a news and all those extending objects (and its classes).
> > On 8 Lip, 18:09, Chtipepere <chtipep...@gmail.com> wrote:
> > > So you mean I have to declare all the relations in the schema.yml ?
> > > For every object I want to be related with an other ?
> > > I can't do more general with object_id and object fields ?
> > > Thanks for your answer
> > > πR
> > > On 8 juil, 16:04, eXtreme <jacek.jedrzejew...@gmail.com> wrote:
> > > > Yes you need a relation, in DQL comma separated "FROM Table t,
> > > > t.Relation r" means the same as "FROM Table t LEFT JOIN t.Relation r"
> > > > > Thanks for you answer, but it didn't change anything, I still have the
> > > > > same error.
> > > > > eXtreme, you said "in DQL you should", should what ? need an explicit
> > > > > relation in the schema ?
> > > > > πR
> > > > > On 8 juil, 03:03, Tom Boutell <t...@punkave.com> wrote:
> > > > > > You shouldn't need a relation to do a "from with commas" implicit join
> > > > > > like this one. Your code would work just the way you wrote it. Except
> > > > > > that in your schema, cars is plural, and in your code it is singular.
> > > > > > You should change cars to Car in your schema.yml.
> > > > > > You should also be consistent about your capitalization although that
> > > > > > might not be a dealbreaker.
> > > > > > > In the schema, there's no relation between news and car, because I
> > > > > > > want to use news for other object (like moto for exemple), and I'm not
> > > > > > > that good to create a behavior.
> > > > > > > Here's the error :
> > > > > > > "Car" with an alias of "Car" in your query does not reference the
> > > > > > > parent component it is related to.
> > But, I think I can't have other fields in Car...
> > In your solution, I have to define TypeObject with all the fields that
> > Car, Bus and Moto should contain
> > e.g. for a car, we want to know if it's a cab or not, for a bus we
> > want to know how many people can seat in, etc...
> > So TypeObject should contain all these fields, because it's a generic
> > object. Am I right ?
> > If so, I'm not sure it's the right solution for my problem...
> > On 8 juil, 19:21, eXtreme <jacek.jedrzejew...@gmail.com> wrote:
> > > Yes, all relations in Doctrine have to be declared.
> > > But there is a different solution for this. :P You can use table
> > > column aggregation inheritance:http://preview.tinyurl.com/m4fjdo
> > > You can create a model "TypeObject" or something like this, then
> > > create other models (like Cars, Buses, Trains whatever :P) inheriting
> > > that TypeObject and create a relation only between TypeObject and
> > > News. A query:
> > > "FROM News n, n.Objects o"
> > > will contain a news and all those extending objects (and its classes).
> > > On 8 Lip, 18:09, Chtipepere <chtipep...@gmail.com> wrote:
> > > > So you mean I have to declare all the relations in the schema.yml ?
> > > > For every object I want to be related with an other ?
> > > > I can't do more general with object_id and object fields ?
> > > > > Yes you need a relation, in DQL comma separated "FROM Table t,
> > > > > t.Relation r" means the same as "FROM Table t LEFT JOIN t.Relation r"
> > > > > > Thanks for you answer, but it didn't change anything, I still have the
> > > > > > same error.
> > > > > > eXtreme, you said "in DQL you should", should what ? need an explicit
> > > > > > relation in the schema ?
> > > > > > πR
> > > > > > On 8 juil, 03:03, Tom Boutell <t...@punkave.com> wrote:
> > > > > > > You shouldn't need a relation to do a "from with commas" implicit join
> > > > > > > like this one. Your code would work just the way you wrote it. Except
> > > > > > > that in your schema, cars is plural, and in your code it is singular.
> > > > > > > You should change cars to Car in your schema.yml.
> > > > > > > You should also be consistent about your capitalization although that
> > > > > > > might not be a dealbreaker.
> > > > > > > > In the schema, there's no relation between news and car, because I
> > > > > > > > want to use news for other object (like moto for exemple), and I'm not
> > > > > > > > that good to create a behavior.
> > > > > > > > Here's the error :
> > > > > > > > "Car" with an alias of "Car" in your query does not reference the
> > > > > > > > parent component it is related to.
No... not in the DB. This is characteristic of column aggregation. But
you still have model classes and they don't share columns. DB is
behind Doctrine.
On 9 Lip, 15:57, Chtipepere <chtipep...@gmail.com> wrote:
> > > But, I think I can't have other fields in Car...
> > > In your solution, I have to define TypeObject with all the fields that
> > > Car, Bus and Moto should contain
> > > e.g. for a car, we want to know if it's a cab or not, for a bus we
> > > want to know how many people can seat in, etc...
> > > So TypeObject should contain all these fields, because it's a generic
> > > object. Am I right ?
> > > If so, I'm not sure it's the right solution for my problem...
> > > On 8 juil, 19:21, eXtreme <jacek.jedrzejew...@gmail.com> wrote:
> > > > Yes, all relations in Doctrine have to be declared.
> > > > But there is a different solution for this. :P You can use table
> > > > column aggregation inheritance:http://preview.tinyurl.com/m4fjdo
> > > > You can create a model "TypeObject" or something like this, then
> > > > create other models (like Cars, Buses, Trains whatever :P) inheriting
> > > > that TypeObject and create a relation only between TypeObject and
> > > > News. A query:
> > > > "FROM News n, n.Objects o"
> > > > will contain a news and all those extending objects (and its classes).
> > > > > So you mean I have to declare all the relations in the schema.yml ?
> > > > > For every object I want to be related with an other ?
> > > > > I can't do more general with object_id and object fields ?
> > > > > > Yes you need a relation, in DQL comma separated "FROM Table t,
> > > > > > t.Relation r" means the same as "FROM Table t LEFT JOIN t.Relation r"
> > > > > > > Thanks for you answer, but it didn't change anything, I still have the
> > > > > > > same error.
> > > > > > > eXtreme, you said "in DQL you should", should what ? need an explicit
> > > > > > > relation in the schema ?
> > > > > > > πR
> > > > > > > On 8 juil, 03:03, Tom Boutell <t...@punkave.com> wrote:
> > > > > > > > You shouldn't need a relation to do a "from with commas" implicit join
> > > > > > > > like this one. Your code would work just the way you wrote it. Except
> > > > > > > > that in your schema, cars is plural, and in your code it is singular.
> > > > > > > > You should change cars to Car in your schema.yml.
> > > > > > > > You should also be consistent about your capitalization although that
> > > > > > > > might not be a dealbreaker.
> > > > > > > > > In the schema, there's no relation between news and car, because I
> > > > > > > > > want to use news for other object (like moto for exemple), and I'm not
> > > > > > > > > that good to create a behavior.
> > > > > > > > > Here's the error :
> > > > > > > > > "Car" with an alias of "Car" in your query does not reference the
> > > > > > > > > parent component it is related to.