I have a class that I am writing and I have a method that I would like to run once per initiation of the class. Normally this would go in the construct method, but I only need it to run when I call certain methods, not all.
How would you all recommend I accomplish this?
Create a private property
$methodHasBeenRunwhich has a defualt value ofFALSE, and set it toTRUEin the method. At the start of the method, do: