modx =& $modx; $basePath = $this->modx->getOption(’getvendors.core_path’,$config,$this->modx->getOption(’core_path’).’components/getvendors/’); $assetsUrl = $this->modx->getOption(’getvendors.assets_url’,$config,$this->modx->getOption(’assets_url’).’components/getvendors/’); $this->config = array_merge(array( ’basePath’ => $basePath, ’corePath’ => $basePath, ’modelPath’ => $basePath.’model/’, ’processorsPath’ => $basePath.’processors/’, ’chunksPath’ => $basePath.’elements/chunks/’, ’jsUrl’ => $assetsUrl.’js/’, ’cssUrl’ => $assetsUrl.’css/’, ’assetsUrl’ => $assetsUrl, ’connectorUrl’ => $assetsUrl.’connector.php’, ),$config); $this->modx->addPackage(’getvendors’,$this->config[’modelPath’],’swc_’); } }
[Thu Feb 03 21:53:30 2011] [error] [client 24.9.59.181] PHP Fatal error: Class ’GetVendors’ not found in /var/www/vhosts/tourwyoming.com/httpdocs/core/xpdo/xpdo.class.php on line 955, referer: http://tourwyoming.signature-ad.com/
<?php
$getvendors = $modx->getService('getvendors','GetVendors',$modx->getOption('getvendors.core_path',null,$modx->getOption('core_path').'components/getvendors/').'model/getvendors/',$scriptProperties);
if (!($getvendors instanceof GetVendors)) return '';
/* setup default properties */
$table = $modx->getOption('select',$scriptProperties);
$tpl = $modx->getOption('tpl',$scriptProperties,'rowTpl');
$sort = $modx->getOption('sort',$scriptProperties,'name');
$dir = $modx->getOption('dir',$scriptProperties,'ASC');
$vendors = $modx->getCollection('Attraction');
$output = count($vendors);
return $output;<?php
class GetVendors {
public $modx;
public $config = array();
function __construct(modX &$modx,array $config = array()) {
$this->modx =& $modx;
$basePath = $this->modx->getOption('getvendors.core_path',$config,$this->modx->getOption('core_path').'components/getvendors/');
$assetsUrl = $this->modx->getOption('getvendors.assets_url',$config,$this->modx->getOption('assets_url').'components/getvendors/');
$this->config = array_merge(array(
'basePath' => $basePath,
'corePath' => $basePath,
'modelPath' => $basePath.'model/',
'processorsPath' => $basePath.'processors/',
'chunksPath' => $basePath.'elements/chunks/',
'jsUrl' => $assetsUrl.'js/',
'cssUrl' => $assetsUrl.'css/',
'assetsUrl' => $assetsUrl,
'connectorUrl' => $assetsUrl.'connector.php',
),$config);
$this->modx->addPackage('getvendors',$this->config['modelPath'],'swc_');
}
}
Do you have a schema that specifies what table getVendors refers to, and did you generate the map file(a) using that schema?
It doesn’t have to be called GetVendors, but the table referred to in the schema for that object has to exist (and I think the names are case-sensitive).
Could you paste your schema here? I’m not seeing it in the .zip file.
<?xml version="1.0" encoding="UTF-8"?> <model package="getvendors" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1"> <object class="Amenity" table="amenity" extends="xPDOObject"> <field key="amenityID" dbtype="int" precision="11" phptype="integer" null="false" default="" index="pk" /> <field key="name" dbtype="varchar" precision="100" phptype="string" null="true" /> <field key="iconImage" dbtype="varchar" precision="100" phptype="string" null="true" /> <field key="feedName" dbtype="varchar" precision="50" phptype="string" null="true" /> <field key="forRestaurant" dbtype="tinyint" precision="4" phptype="integer" null="true" /> <field key="forLodging" dbtype="tinyint" precision="4" phptype="integer" null="true" /> <field key="forAttraction" dbtype="tinyint" precision="4" phptype="integer" null="true" /> <field key="isActive" dbtype="tinyint" precision="4" phptype="integer" null="false" default="" /> <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE" > <column key="amenityID" length="" collation="A" null="false" /> </index> </object> <object class="Attraction" table="attraction" extends="xPDOObject"> <field key="attractionID" dbtype="int" precision="11" phptype="integer" null="false" default="" index="pk" /> <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default="" /> <field key="address1" dbtype="varchar" precision="255" phptype="string" null="false" default="" /> <field key="address2" dbtype="varchar" precision="255" phptype="string" null="false" default="" /> <field key="city" dbtype="varchar" precision="100" phptype="string" null="false" default="" /> <field key="state" dbtype="char" precision="2" phptype="string" null="false" default="" /> <field key="zip" dbtype="varchar" precision="10" phptype="string" null="false" default="" /> <field key="website" dbtype="varchar" precision="255" phptype="string" null="false" default="" /> <field key="pdf1" dbtype="varchar" precision="255" phptype="string" null="true" /> <field key="pdf2" dbtype="varchar" precision="255" phptype="string" null="true" /> <field key="pdf3" dbtype="varchar" precision="255" phptype="string" null="true" /> <field key="picture" dbtype="varchar" precision="255" phptype="string" null="true" /> <field key="email" dbtype="varchar" precision="255" phptype="string" null="false" default="" /> <field key="phoneArea" dbtype="varchar" precision="3" phptype="string" null="true" /> <field key="phonePrefix" dbtype="varchar" precision="3" phptype="string" null="true" /> <field key="phoneSuffix" dbtype="varchar" precision="4" phptype="string" null="true" /> <field key="phone" dbtype="varchar" precision="50" phptype="string" null="false" default="" /> <field key="faxArea" dbtype="varchar" precision="3" phptype="string" null="true" /> <field key="faxPrefix" dbtype="varchar" precision="3" phptype="string" null="true" /> <field key="faxSuffix" dbtype="varchar" precision="4" phptype="string" null="true" /> <field key="fax" dbtype="varchar" precision="50" phptype="string" null="false" default="" /> <field key="description" dbtype="longtext" phptype="string" null="false" default="" /> <field key="latitude" dbtype="double" phptype="float" null="false" default="" /> <field key="longitude" dbtype="double" phptype="float" null="false" default="" /> <field key="isVignette" dbtype="tinyint" precision="4" phptype="integer" null="false" default="" /> <field key="googleCID" dbtype="varchar" precision="50" phptype="string" null="true" /> <field key="dateCreated" dbtype="datetime" phptype="datetime" null="false" default="" /> <field key="lastUpdated" dbtype="datetime" phptype="datetime" null="false" default="" /> <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE" > <column key="attractionID" length="" collation="A" null="false" /> </index> </object> </model>
$path = $modx->getOption('getvendors.core_path',null,$modx->getOption('core_path').'components/getvendors/').'model/getvendors/';
$getvendors = $modx->getService('getvendors','GetVendors',$path,$scriptProperties);
if (!($getvendors instanceof GetVendors)) return 'Error - Path: ' . $path;
I don’t see anything obvious (though Shaun might). I would try something like this first to make sure the path is getting set correctly:
$path = $modx->getOption('getvendors.core_path',null,$modx->getOption('core_path').'components/getvendors/').'model/getvendors/'; $getvendors = $modx->getService('getvendors','GetVendors',$path,$scriptProperties); if (!($getvendors instanceof GetVendors)) return 'Error - Path: ' . $path;