createSkeletonFromPropel

1 view
Skip to first unread message

rfallis

unread,
Jul 2, 2008, 4:48:35 AM7/2/08
to phocoa users, cmi...@scratchspace.com
This may well be more of a Propel-ish question...

I set up a couple of tables with a foreign-key relation in mysql, ran
newProject, tweaked a couple of files and set up a module. One of
these tables is "Nameset". When I ran one of the views I got the
complaint

PHP Fatal error: Cannot redeclare
BaseNameset::getNamesetRelatedById() in /home/rfallis/www/zoa2/zoa2/
classes/zoa/om/BaseNameset.php on line 952

. Looking back, I notice this also occurred with phocoa >
createSkeletonFromPropel:

Database Name: [zoa2] zoa
Table Name: nameset
Column name of single column that best describes the table: id
Module Name: [nameset] info
[php] Evaluating PHP expression: require('/home/rfallis/www/zoa2/
zoa2/conf/webapp.conf')
[exec] Executing command: /usr/bin/php /usr/local/phocoa/
framework/createModule.php info 2>&1
[exec] Writing info/info.php
[exec] Done building module info!
[exec] Executing command: /usr/bin/php /usr/local/phocoa/
framework/createSkeletonFromPropel.php --phocoaConfFile=/home/rfallis/
www/zoa2/zoa2/conf/webapp.conf --propelOutputDir=/home/rfallis/www/
zoa2/zoa2/classes --propelConfFile=/home/rfallis/www/zoa2/zoa2/conf/
zoa-conf.php --databaseName=zoa --tableName=nameset --columnName=id --
pageType=search,edit,detail 2>&1
[exec] PHP Fatal error: Cannot redeclare
BaseNameset::getNamesetRelatedById() in /home/rfallis/www/zoa2/zoa2/
classes/zoa/om/BaseNameset.php on line 952
[exec]
[exec] Fatal error: Cannot redeclare
BaseNameset::getNamesetRelatedById() in /home/rfallis/www/zoa2/zoa2/
classes/zoa/om/BaseNameset.php on line 952
[exec] Executing command: /usr/bin/php /usr/local/phocoa/
framework/util/convertModuleToYAML.php info 2>&1
[exec] Converting shared setup to YAML for module at: 'info'
[exec] Checking ..
[exec] Checking info.php
[exec] Checking .
[exec] Executing command: mv suggested_code.php info.php 2>&1

I'm curious about what createSkeletonFromPropel is doing here that it
would reach the error on build that I get on view.

Any ideas or suggestions would be apprecated.

Thanks.

rfallis

unread,
Jul 3, 2008, 4:57:51 PM7/3/08
to phocoa users
I resolved the issue here by simplifying the relationship of the
tables involved. However, I'm still getting a complaint about a
missing class. What I'd like to know now is what further table/key-
relationship changes I need to make in order to get this to work.

rfallis

unread,
Jul 7, 2008, 12:40:06 PM7/7/08
to phocoa users
I fully resolved this by making the referencing key non-primary.
Apparently, while mysql is ok with using a primary key this way,
propel (at least v 1.3) will not create what phocoa needs in this
case.

The version of propel I'm using has evolved since it it was originally
installed, so perhaps the latest release will function differently.

Alan Pinstein

unread,
Jul 10, 2008, 6:32:58 PM7/10/08
to phocoa...@googlegroups.com
Interesting... thanks for the notes!

BTW sorry it took me so long to respond. I was out of the country for
2 weeks.

The createSkeletonFromPropel stuff is really sensitive to database
structure of course. I am continuing to try to stabilize that code
for other situations. Plus, I use only postgresql so it wouldn't be
well-tested for any mysql+propel quirks.

Alan

Reply all
Reply to author
Forward
0 new messages