Hi Juan,
The way you make it is so easy i was scratched my head to do the search and you make it with 3 lines !!
Even if i read the code i don not understand well the search function in OsClass can you explain me more about that because i will have to work with this function in about every pluggin i will mada so ist better to ask question now.
Search::newInstance()->addConditions(sprintf("%st_item_watchlist.fk_i_user_id = %d", DB_TABLE_PREFIX, $i_userId));
That will result in :
SELECT * FROM oc_t_item LEFT JOIN oc_t_item_watchlist ON (pk_i_id = fk_i_item_id) WHERE oc_t_item_watchlist.fk_i_user_id = 1 LIMIT 0,5
So addConditions is only use when we are dealing with items ?
%st_item_watchlist.fk_i_user_id = %d" will be parse to make that condition : ON (pk_i_id = fk_i_item_id) ?
Search::newInstance()->addTable(sprintf("%st_item_watchlist", DB_TABLE_PREFIX));
What exactly this is doing ?
Search::newInstance()->page($iPage, $itemsPerPage);
This had the Limit 0,5 at the end of the query i am correct ?
$aItems = Search::newInstance()->doSearch();
Make the search and return it in a array()
$iTotalItems = Search::newInstance()->count();
Will return number of row from this query, but this ignore the page function ?
Did i understand it like it suppose to be ?
Thanks