Quick question,
My plugin needs to use multiple related tables
modx_mmSubscribers
modx_mmNewsletters
modx_mmSubscribedTo
- do I need to create multiple xml schemas? This doesn’t appear in any documentation that I have read and is confusing the hell out of me because if I create multiple schemas do I need to also create multiple models? I’ll have a ton of models/classes etc etc
Or do I create multiple objects within a single schema ? for example:
<model package="mmNewsletters" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM"
phpdoc-package="mmNewsletters" phpdoc-subpackage="">
<object class="mmSubscribers" table="mmSubscribers" extends="xPDOSimpleObject">
<field key="id" dbtype="int" precision="10" phptype="string" null="false" default="" />
<field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
<field key="email" dbtype="varchar" precision="255" null="false" default="" />
</object>
<object class="mmNewsletters" table="mmNewsletters" extends="xPDOSimpleObject">
<field key="id" dbtype="int" precision="10" phptype="string" null="false" default="" />
<field key="newsletter" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
<field key="template" dbtype="varchar" precision="255" null="false" default="" />
</object>
<object class="mmSubscribedTo" table="mmSubscribedTo" extends="xPDOSimpleObject">
<field key="id" dbtype="int" precision="10" phptype="string" null="false" default="" />
<field key="subscriberID" dbtype="int" precision="10" phptype="string" null="false" default="" />
<field key="newsletterID" dbtype="int" precision="10" phptype="string" null="false" default="" />
</object>
And then the model would contain all the necessary access to each class ? and thus allow me to build the correct database calls and queries between them ?
Also can someone decipher the following:
// you'll want to change this first line to point to the actual MODx install path
define('MODX_BASE_PATH', dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . '/MODx 0.9.7/');
Does one remove the dirname(dirname( etc etc and fill it with the physical path to my modx install ie /users/digbookpro/sites/ or just the part in the quotes ?
These are the simple things that make the tutorials easy to follow or completely mindbending - I am willing to play but I put this here as the information isn’t clear...
Regards,
MM