If the DB tables exist already and the relationships are not too complex, this might be another option:
http://bobsguides.com/custom-db-tables.html
You may have to edit the schema between the steps.
-
☆ A M B ☆
- 756 Posts
Quote from: lucas at Jul 07, 2011, 01:40 AM
Hi Charles, I think your class is ok - Shaun must have extended his Doodle class to add the extra save functionality.
Otherwise all I can suggest is to perhaps set these files aside and walk yourself through the Doodles tutorial again. Sometimes it’s easier to start again than to try and find an error in code you’ve been chopping and changing.
Yep, did that several times and always end up with the could not get table error.
[2011-07-07 09:21:37] (ERROR @ /modxrevo/index.php) Could not get table name for class: Awdbio
I’ve started from scratch completely... new ModX Revo install and all new files... crossing my fingers
Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
Visit
CharlesMx.com for latest news and status updates.
-
☆ A M B ☆
- 756 Posts
Quote from: BobRay at Jul 07, 2011, 02:38 AM
If the DB tables exist already and the relationships are not too complex, this might be another option:
http://bobsguides.com/custom-db-tables.html
You may have to edit the schema between the steps.
thanks, that might have to be the end solution though I was intending on a more complex table structure to get as normalized as possible... but deadline is looming so might just have to try that method
Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
Visit
CharlesMx.com for latest news and status updates.
-
☆ A M B ☆
- 756 Posts
Quote from: lucas at Jul 07, 2011, 10:25 AM
One more thing you could try as since Revo 2.1 you may need to explicitly set AUTO_CREATE_TABLES to ’true’.
Take a look OpenGeek’s suggestions here:
http://modxcms.com/forums/index.php?topic=64368.0
Thanks, that might save me some time as I just jumped from 2.0.8 to the latest version 2.1.2
I’ll let you all know how well this round goes. I’m still baffled that I get that error when my local machine creates the xPDO class files but I I use the actual Doodles source zip file and the classes that are already packaged it makes the database tables just fine with no issues.
Cheers
Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
Visit
CharlesMx.com for latest news and status updates.
Quote from: charless at Jul 07, 2011, 09:24 AM
Quote from: BobRay at Jul 07, 2011, 02:38 AM
If the DB tables exist already and the relationships are not too complex, this might be another option:
http://bobsguides.com/custom-db-tables.html
You may have to edit the schema between the steps.
thanks, that might have to be the end solution though I was intending on a more complex table structure to get as normalized as possible... but deadline is looming so might just have to try that method
You can edit the schema file to add the relationships between the tables before doing the final step.
-
☆ A M B ☆
- 756 Posts
Still think I have a name mismatch since I can’t get anything I do locally to run, although the Doodles example will work if I download the source files - but I can’t recreate the xPDO class files or I get the same errors as when I build everything from scratch.
I’m running on a Linux box with php5.3 and Revo 2.1.2 tried with Lighty and Apache no luck... I’ll keep plugging away until I figure this out....
Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
Visit
CharlesMx.com for latest news and status updates.
-
☆ A M B ☆
- 3,141 Posts
How are you creating the class files?
For reference, here’s how I create the tables from an external file in my _build directory..
<?php
require_once dirname(dirname(__FILE__)) . '/config.core.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx= new modX();
$modx->initialize('mgr');
$modelPath = $modx->getOption('providerx.core_path',null,$modx->getOption('core_path').'components/PKG NAME/').'model/';
$modx->addPackage('lowercasepackagename',$modelPath);
$manager = $modx->getManager();
$modx->setLogLevel(modX::LOG_LEVEL_ERROR);
$manager->createObjectContainer('objectName');
$manager->createObjectContainer('otherObjectName');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
echo 'done';
?>
-
☆ A M B ☆
- 756 Posts
Creating the classes with the folowing (as provided in modExtra) and also used the same processes as defined in the Doodles examples.
<?php
//-- Short Hand
$awdbios = $modx->getService('awdbios','Awdbio',$modx->getOption('awdbios.core_path',null,$modx->getOption('core_path').'components/awdbios/').'model/awdbios/',$scriptProperties);
if (!($awdbios instanceof Awdbio))
return '<br />NO instance of Awdbios.<br />';
$output = '';
$m = $modx->getManager();
$created = $m->createObjectContainer('Awdbio');
return $created ? 'Table created.' : 'Table not created.';
return $output;
Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
Visit
CharlesMx.com for latest news and status updates.