drunkenmyno Posted February 24, 2015 Share Posted February 24, 2015 (edited) Hello , i have a problem in my own Object class. i define with $this->className my class and the data get loaded into the the edit form fields but when i click on Save i get the message that my class cannot be found. Fatal error: Class 'GeoObject' not found in D:\path_to_shop\classes\controller\AdminController.php on line 1418 i looked into line 1418 and this is the function of loadObject so the save button click reject my already loaded Object any solution ?? this is my object class <?php class GeoObject extends ObjectModel { public $id; public $id_category; public $id_product; public $name; public $active; public static $definition = array( 'table' => 'ge_up', 'primary' => 'id', 'multilang' => false, 'multishop' => true, 'fields' => array( 'id_category' => array('type' => self::TYPE_INT, 'validate' => 'isInt'), 'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isInt'), 'active' => array('type' => self::TYPE_INT, 'validate' => 'isInt'), 'name' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml', 'required' => true, 'lang' => false, 'size' => 255), ) ); public function __construct($id = null, $id_lang = null) { Shop::addTableAssociation(self::$definition['table'], array('type' => 'shop')); parent::__construct($id, $id_lang); } } ?> Thanks Edited February 24, 2015 by drunkenmyno (see edit history) Link to comment Share on other sites More sharing options...
drunkenmyno Posted February 24, 2015 Author Share Posted February 24, 2015 (edited) Edit: solved it by copying the object class into Class folder from ps but i cannot use it from my module folder. is there any trick ? Edited February 24, 2015 by drunkenmyno (see edit history) Link to comment Share on other sites More sharing options...
cristic Posted February 24, 2015 Share Posted February 24, 2015 (edited) In your module file, you need to include this new class: require_once('path_to_class/GeoObject.php'); This way, you don't need to copy to /classes folder. Edited February 24, 2015 by cristic (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now