parent child problems in 3.2

31 views
Skip to first unread message

lkasdorf

unread,
Jul 22, 2014, 12:04:27 AM7/22/14
to php-object...@googlegroups.com
First- let me thank you again for the great POG system and the maintenance and improvements that you do.

That being said, I have encountered major issues involving parent child relationships in ver 3.2

Lets say I want a database of contractors. Each contractor does various types of work, which I'll call a category.

So- I create:
-----------
object "category"
fields:
"code": varchar
"desc": varchar
"contractor": parent of type "contractor"

http://www.phpobjectgenerator.com/?language=php5&wrapper=pog&objectName=category&attributeList=array+%28%0A++0+%3D%3E+%27code%27%2C%0A++1+%3D%3E+%27desc%27%2C%0A++2+%3D%3E+%27contractor%27%2C%0A%29&typeList=array+%28%0A++0+%3D%3E+%27VARCHAR%28255%29%27%2C%0A++1+%3D%3E+%27VARCHAR%28255%29%27%2C%0A++2+%3D%3E+%27HASMANY%27%2C%0A%29
-----------

object "contractor"
fields:
"name": varchar
"cat1": child of type "category"

http://www.phpobjectgenerator.com/?language=php5&wrapper=pog&objectName=contractor&attributeList=array+%28%0A++0+%3D%3E+%27name%27%2C%0A++1+%3D%3E+%27cat1%27%2C%0A%29&typeList=array+%28%0A++0+%3D%3E+%27VARCHAR%28255%29%27%2C%0A++1+%3D%3E+%27BELONGSTO%27%2C%0A%29

-----------

When I attempt to POG it up, I get this error:

category refers to contractor as {Child}, but contractor does not refer to category as {Parent}. Relations need to be reciprocal.
contractor refers to cat1 as parent, which couldn't be found. Generate the cat1 object with reference to contractor as {Child}

So- if a parent field's name must be the exact name of the class, what is the point of the class field? This is a problem, because I need to have 4 category fields- each of which is a parent.

I can't do this with siblings because, once again, the name of the sibling field must be the name of the sibling class.

Sounds like a bug to me?
Thanks-
Lynn Kasdorf


Reply all
Reply to author
Forward
0 new messages