0

Hi guys,

Just wanna ask what the "::" is for? ex.

CRM_ContactsCommon::get_my_record()

Correct me if I'm wrong, the CRM_ContactsCommon is a class and the get_my_record is a function inside the class. Now, is the "::" works the same way like in java to access a function of a class?

Thank you in advance.

3
Contributors
5
Replies
28
Views
2 Years
Discussion Span
Last Post by Kewne
1

In PHP :: is used to denote a static class i.e. one that does not need the class to be instantiated first.
If the method is not static you need to instatiate the class and then access the method via $class->someMethod().

0

Thank you hericles for the brief description :)
Thank you pixelsoul for the link, I really dont know what to call the colon-colon ( :: ).

0

Just checked the link, and....yes you're right,...
From now on I'll that too as double colon.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.