Myst26 Posted February 18, 2013 Share Posted February 18, 2013 Bonjour, Question relative à la surcharge du constructeur au niveau d'un module Prestashop. J'essaie tant bien que mal de surcharge la méthode __construct de l'object model d'une classe. Exemple : class RegionData extends ObjectModel { public function __construct($id = null, $id_lang = null, $id_shop = null) { parent::__contruct($id, $id_lang , $id_shop); $this->fieldImageSettings = array( 'name' => 'image', 'dir' => 'r' ); } } Et j'ai l'erreur suivante qui apparait : Fatal error: Call to undefined method ObjectModel::__contruct() Link to comment Share on other sites More sharing options...
SMorillon.com Posted February 18, 2013 Share Posted February 18, 2013 Bonjour, Il manque un s : parent::__construct($id, $id_lang , $id_shop); Link to comment Share on other sites More sharing options...
Myst26 Posted February 19, 2013 Author Share Posted February 19, 2013 "moment de solitude" L'erreur saute au yeux, effectivement. Merci SMorillon ! 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