SkyPHP/skyphp — pull request #167 by stanistan (2012-08-14 15:33:42+00:00)
Title: refactor autogenerating a getList, so it can be reused

Now if overriding the `Model::getList` and you want to also keep default behavior without rewriting it, you can do:

```php
addJoin('tour on tour.artist_id = artist.id')
->defineFilters([
'tour' => [
'callback' => function($val) use($lst) {
$list->where[] = "tour.name = '{$val}'";
}
]
]);

return $count ? $list->getCount($a) : $list->select($a);
}

}

/// .... usage

$artist = artist::getOne([
'name' => 'Red Hot Chili Peppers',
'tour' => 'Coachella'
]);

```