Menu
Good Morning,
I only have basic skills in procedural coding in PHP but am trying to get into Object Oriented.
I have a question, If I had a class called person (to keep it generic). I can create a person object from a form submission, such as $person = new person($_POST[]…);
Can I have a method in my class called getPersonFromID() which creates the person within the class?
$personObject = new Person;
$person = $personObject->getPersonFromID(44);
Does this work or should I have another class to retrieve and create people from places like a database?
Thank you and I am learning.