Is there a function/method which retrieves all of the attributes from a class? Such as all the attributes from my class below:
class plantOfTheMonth {
//Declare which centre(s) are being used
private $centre = "";
//Declare the attributes of the current Plant Of The Month
private $name = "";
private $latinName = "";
private $image = "";
private $imageAlt = "";
private $imageLink = "";
private $strapLine = "";
private $description = "";
private $color = "";
private $centres = "";
//Declare variables for error handling
private $issue = "";
private $issueCode = "";
}
Use
ReflectionClass::getProperties()from Reflection API orget_object_vars()function.