List of PrestaShop Object Model Data Types and Validation Methods

Hi guys, hows going 🙂 PrestaShop Object Model helps you make your database requests efficient. This approach is used in MVC development. This post lists PrestaShop Object Model validation methods and data types which is helpful for beginners.

For those who feel a bit of confusion in understanding of Object Model, let me clear it a bit. When you are developing a module or any web application. You will definitely need to create and interact with databsse. In order to create database tables, insert, delete, modify or update information, you can write code in your main PHP file.

But this approach is not efficient, since you may need to use same method in several PHP files. This is very similar to a concept of function or a class. To make a code re-usable and efficient, a new approach was established for modular programming, and that is MVC (Model-View-Controller).

This approach  simple creates separate file and folder structure for presentation and business logic. You keep frontend logic separate, development and database logic separate. 🙂

In PrestaShop when you create an object model, you must follow below steps,

Create one public variable for each db column and then define definitions array (must). To define this array, follow these steps,

  • Set database table
  • Set the primary key
  • Set multi-language key
  • Set fields array

Examples of PrestaShop Object Model


In above example, you might have noticed following 2 things in this line,

  • ‘type’
  • ‘validate’

Here is a complete list of data types and validate methods you can use here,

List of PrestaShop Object Model Data Types and Validation Methods

Data Types:


Validation Methods:

Just use names from the following methos like, isEmail, isModuleURL etc. Here is a complete definition,


Hope it helps 🙂

  • June 24, 2017
  • 0
Sohail ahmed
About me

Love to train and learn. SEO and development is my profession. 10+ years of IT training, practical experience in SEO. Creativity helps me strategize things well, especially when i code.