Moraes Moraes -4 years ago 218
PHP Question

PHP - Using static attributes and methods

If I have a class called Sales, which has only static attributes and
methods:
- What kind of constructor should I write for this class?
- How can I make calls to the methods and attributes of this class inside of its own scope?

Answer Source

You can use self::method(); operator to call it's own methods and attributes..

Constructor

private function __construct()
{
   // Your "heavy" initialization stuff here
}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download