Jump to content

Understanding Class naming conventions


Mr A

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...