Shaun,
I get the abstraction and can ’read’ the xpdo queries and agree that the access to the data will be far easier but the problem comes in getting the models/classes built in the first place... Once I get this nailed then I think that the development of the CMP and the ’straight’ php processors will infact be relatively simple - especially as by using modext I get a very easy to use ’ide’ of sorts for the structure of the forms.
However, I have to say though that the documentation is desperately vague as to how to setup everything - it almost expects you to be one of the modx team to understand what goes where etc etc.
As of yet I still haven’t been able to get my build script to generate a single model file and I have now followed two different sets of instructions in the revolution documentation one from here:
http://svn.modxcms.com/docs/pages/viewrecentblogposts.action?key=~splittingred
and the other from here:
http://svn.modxcms.com/docs/display/xPDO20/Generating+the+Model+Code
Both the examples break the code down to an extent that they become illogical and hard to read (it almost needs a downloadable file of the example and an image showing where in the directory structure things should go) for example in the generate the model code:
Loading xPDOManager and xPDOGenerator
Create a PHP file where you have access to an xPDO instance. Then, let’s set the Log Target to the browser, and raise it a bit to get more detailed information.
$xpdo->setLogLevel(xPDO::LOG_LEVEL_INFO);
$xpdo->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
Now, we’ll want to load the xPDOManager and xPDOGenerator classes, to assist us with the model deployment.
$manager= $xpdo->getManager();
$generator= $manager->getGenerator();
Setting Class and Map Templates
Setting the Templates is completely optional. xPDO provides you with some basic templates that will work fine.
By default, xPDO provides you with default class and map templates. For the purposes of this example, however, we want to create class files and maps with PHPDoc formatting at the top, so we’ll need to override the default class and map templates.
To do so, we’ll just override the variables in the $generator object:
$generator->classTemplate= <<<EOD
<?php
/**
* [+phpdoc-package+]
*/
class [+class+] extends [+extends+] {}
?>
EOD;
$generator->platformTemplate= <<<EOD
<?php
/**
* [+phpdoc-package+]
*/
require_once (strtr(realpath(dirname(dirname(__FILE__))), '\\\\', '/') . '/[+class-lowercase+].class.php');
class [+class+]_[+platform+] extends [+class+] {}
?>
EOD;
$generator->mapHeader= <<<EOD
<?php
/**
* [+phpdoc-package+]
*/
EOD;
’Create a PHP file where you have access to an xPDO instance’ <- what does that mean, I tried by having the file in a subdirectory with my schema but I get nothing...
When I follow this and create a php build file in the folder with the schema I still get no results from the script... The examples aren’t starting from the right level - they expect an understanding that only the dev’s probably have as of now