justinl Posted February 3, 2011 Share Posted February 3, 2011 Hello,I've just started developing with Prestashop and writing my own modules. One question that comes to mind is what is the difference or purpose to using OR or AND when writing the install() method of a module.Consider these two code snippets: function install() { if (!parent::install() OR !$this->registerHook('top') OR !$this->registerHook('header')) return false; return true; } public function install() { return (parent::install() AND $this->registerHook('top') AND $this->registerHook('header')); } What is the purpose of using AND or OR? What do they do? All I can figure out is that if you use AND, it installs your module by default into those hooks. Any light shed on this or a link to some documentation would be much appreciated.Thanks 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