08/07/2010 11:26am

PHP | Problem - DataObjectManager class not found


********** Infobox.php ************


<?php
class Infobox extends DataObject {
static $db = array(
'Header' => 'Varchar',
'Description' => 'HTMLText',
'Link' => 'Varchar',
);
static $has_one = array(
'File' => 'Image',
'FrontPage' => 'FrontPage'
);
static $singular_name = 'Infobox';

static $plural_name = 'Infoboxes';

public function getCMSFields_forPopup() {
return new FieldSet(
new TextField('Header'),
new SimpleHTMLEditorField('Description'),
new TextField('Link'),
new FileIFrameField('File')
);
}
}
?>

********* FrontPage.php ***********

<?php

class FrontPage extends Page {

public static $db = array(
);

public static $has_one = array(
);

public static $has_many = array(
'Infoboxes' => 'Infobox'
);

public function getCMSFields() {
$fields = parent::getCMSFields();


$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Infoboxes", new DataObjectManager(
$this,
'Infoboxes',
'Infobox',
array('Header' => 'Header','Description'=>'Description','Link' => 'Link', 'File' => 'File'),
'getCMSFields_forPopup'
));

return $fields;
}

function ActiveInfoboxes() {
return DataObject::get("Infobox", "FrontPageID = " . $this->ID);
}
}

class FrontPage_Controller extends Page_Controller {


}

?>

Getting an error as I try to enter the CMS:

Fatal error: Class 'DataObjectManager' not found in /var/www/clients/client31/web38/web/mysite/code/FrontPage.php on line 20

Tags : DataObjectManager

Post Comment