Mr A Posted October 10, 2011 Share Posted October 10, 2011 I am working on a new page for my site (PS v1.4) which will access a new table in the database. I am using the category pages and classes and controller as an example. I was expecting to find a file that defined the "Category" class as there are many places in the code which call "new Category(...)" - for example in CategoryController.php. The closest I've come is finding the "CategoryCore" class definition in classes/Category.php. Can someone explain where I find the constructor for class "Category"? Thank you Link to comment Share on other sites More sharing options...
MrBaseball34 Posted October 10, 2011 Share Posted October 10, 2011 This is the constructor for the Category class in classes/Category.php Read up on PHP before trying to do what you are doing. public function __construct($id_category = NULL, $id_lang = NULL) { parent::__construct($id_category, $id_lang); $this->id_image = ($this->id AND file_exists(_PS_CAT_IMG_DIR_.(int)($this->id).'.jpg')) ? (int)($this->id) : false; $this->image_dir = _PS_CAT_IMG_DIR_; } Link to comment Share on other sites More sharing options...
Mr A Posted October 10, 2011 Author Share Posted October 10, 2011 Thank you So why is the class called "Class CategoryCore" at the top of the file, rather than "Class Category"? If I want to create a new class called "MyClass", should I name it "MyClassCore"? 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