Say I have a class like this:
class Person
{
private $value;
public function __construct()
{
$this->value = 'new';
}
public static function find( $ident )
{
$person = new Person();
$person->value = 'old';
return $person;
}
}
How can I keep the constructor from firing, or diverting it in some way to not execute some of itself if I am calling from the static find function?
The context of my example is identical to that of my real code, except the real code has a perfect amount of overhead so long that only one of the functions is ever executed. (Many objects can exist at the same time, however if the static function calls the __construct method, then there is too much overhead and loading time).
Both need to have public accessors.