I started reading some tutorials about OOP, because I want to learn the basics.I have a question about it. I understand how you can have a object Car and give it a color like this $oCar->setColor(white); But there are some things unclear to me. Let's say I have a database with all kinds of cars. What is the best way to create the object car? A SQL-query instead the class?And the other question is: how can I output a list of all cars? Do I need to create a object called Garage with has only one method within that selects all the cars from the database? Or does this kind of method belong in the Car object?
OOP (php) for beginners - some unclarities
php;mysql;sql;object oriented