Lets asume we have Table Data Gatway built ....with CRUD and everything on a db table.
From ther on we start by findByName() method..... findByDate() method etc.
Now, this starts too look fishy...because if you want to seach by name and date you will build a 3rd method findbByNameAndDate() which is wrong.
So I am thinking of making on Find interface or abstract class. And implement from there
Find_Date implements Find
Find_Name implements Find
and then just build some compose object or something
Code: Select all
$table->find (new Find_Date('2006-03-03'), new Find_Name('Tom')) ;Maybe someone more experienced will like to clarify the idea and show the right way to do it