Post by straightlight » Sat Jun 11, 2016 10:28 pm

In OC v.2.2.0.0 - catalog/model/extension/event.php file,

find:

Code: Select all

function getEvents() {
replace with:

Code: Select all

public function getEvents() {

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by i2Paq » Mon Jun 13, 2016 2:47 pm

Explain what the issue is please.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by straightlight » Mon Jun 13, 2016 11:43 pm

i2Paq wrote:Explain what the issue is please.
Sure, no problem.
Classes are not just "function containers", they are there to represent an object, an entity. They are supposed to encapsulate the data required for the given entity with methods that work for it.

Sometimes there might be a class of object that only needs one method defined for it, but nevertheless it only belongs to that class of object.
Source: http://stackoverflow.com/questions/6417 ... e-function

In other words, single functions can't be used inside classes obviously which is why a public method in this case needs to be set.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by i2Paq » Tue Jun 14, 2016 2:00 am

Haha, I meant; what happens when it is not changed? ;)

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by straightlight » Tue Jun 14, 2016 2:15 am

i2Paq wrote:Haha, I meant; what happens when it is not changed? ;)
Then it would become an inherited method of another class which, in this case, does not represent any other class than the one being extended; the controller engine.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by i2Paq » Tue Jun 14, 2016 4:06 am

What behavior will occur or what error?

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by straightlight » Tue Jun 14, 2016 4:57 am

This topic seem to be in the wrong section. I wanted to post this change in the 'Concepts' section, not in the bug reports. Missing the public in front will not create an error since PHP 4, it seem to have been added for backward compatibility.

Source: http://stackoverflow.com/questions/1098 ... -of-public

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 4 guests