I try to write OOP class, that makes searching by some incoming parameters. I can doing search by location, category, name and others things. How to make this class more professionally, abstract?
Now I have just one method in the class, that accepts request:
private function search($request)
{
// TODO
}
The $request can contains any parameters described above.
I dont like to do:
if($request->category){
} else if($request->location){
} else if($request->name){
} ... etc
Aucun commentaire:
Enregistrer un commentaire