PHP Класс FilterBehavior, cakephp-filter

Наследование: extends ModelBehavior
Показать файл Открыть проект

Открытые методы

Метод Описание
beforeFind ( &$model, $queryData ) : array Adapted from work by Brenton (http://bakery.cakephp.org/articles/view/habtm-searching) New function to help with searching where conditions involve HABTM.

Описание методов

beforeFind() публичный Метод

Nothing too fancy for now, just deals with first level (ex. no with), also, not sure how it'll react for multiple fields. So pretty much just best for id of a foreign key. For HABTM, association condition should not be on the join table, but association. So if: User HABTM Interests, and searching for Users, should be Interest.id. TODO: End result uses the 'IN' operator for the query, which is equivalent to 'OR', and will eventually want 'AND' instead. TODO: Test in conditions where no 'with'
public beforeFind ( &$model, $queryData ) : array
Результат array Modified queryData array