I have a weird issue. I have two snippets access custom db classes. One retrieves the data just fine while the other gives me a fatal error accessing the same class:
PHP Fatal error: Call to undefined method OrganizationVendors_mysql::prepare() in /paas/c2356/www/core/xpdo/om/xpdoobject.class.php on line 233
The relevant snippet code is:
<?php
$path = MODX_CORE_PATH . 'components/myComponent/';
$result = $modx->addPackage('myComponent',$path . 'model/','mycomponent_');
if (!$result) {
$output = 'failed to load class';
} else {
$orgID = $modx->getOption('orgID', $scriptProperties);
if ($debug) trigger_error($snippetname . " OrgID : " . $orgID, E_USER_ERROR);
$orgVendors = $modx->getCollection('OrganizationVendors',array('organization' => $orgID));
As you can see I am outputting the $orgID var so I know it is defined in both cases. Any ideas why would one snippet work fine and the other fail?