I updated an object, and version changed, now I must use include_once

46 views
Skip to first unread message

lkasdorf

unread,
Jul 19, 2014, 11:20:15 AM7/19/14
to php-object...@googlegroups.com
I have a huge project that uses POG and the objects are at version 3.0e. I needed to add a couple fields to an object, so I grabbed the link and pasted into the POG regeneration page:
http://www.phpobjectgenerator.com/regenerate.php

I ended up with a new object that is version 3.2. This object has parent/child relations, and the way the new code is written, related classes are included right in the object code itself- this was not the case before.

Alas, this broke my site! I had been simply using "include" to pull in my object class files. I was getting an error "cannot redeclare object ...". I went through and changed all includes to include_once and it fixed it.

However, now I need to update all my objects to the same version, at least i think that would be wise.

So- here is my question:

Once I get it all working again, how can I avoid screwups like this in the future as changes are made to POG? I've never gotten the "upgrade" button to work in the POG UI. Should I grab the latest code and set up my own POG generator to use next time I need to modify my objects?

Thanks-
Lynn Kasdorf

Crispy

unread,
Jul 19, 2014, 6:09:36 PM7/19/14
to php-object...@googlegroups.com
Hi,

If you are needing a particular version and setting up a generator for yourself is easy enough, it would be a good idea to do that.

The newest version of POG does address some important issues so updating to the latest version should make life easier in the long run. It's definitely not changing much any more.

regards,
Mark

Lynn Kasdorf

unread,
Jul 24, 2014, 2:31:42 PM7/24/14
to php-object...@googlegroups.com
Hi-
I posted this in the google forum, but I think nobody has seen it.

Anyway, there seems to be a definite bug where I'd like to have a parent
variable in an object that has a name different than the class of the
parent. And when I do this, it gets an error in the pog me up phase.

Basically, I want a field named "cat1" that is a parent of type
"category" - and it will not let me do this. If I make the variable name
"category", it works. In that case, the class field is pointless.

The reason this matters is that I need cat1, cat2, cat3, cat4 fields,
all of which will be parent links to type "category".

So, if you can tell me whether this is a known problem, that would be
great. Look at the pog google forum to see details including links:

https://groups.google.com/forum/#!topic/Php-Object-Generator/eB_g1SFL8jU
<https://groups.google.com/forum/#%21topic/Php-Object-Generator/eB_g1SFL8jU>

Thanks much!
Lynn Kasdorf
Reply all
Reply to author
Forward
0 new messages