Looks good to me. One concern I have is how we handle custom find
methods that add fields. We should make sure that modifying
query['fields'] doesn't cause the count operation to fail. Perhaps
adding a separate key to the query data to indicate its a count
operation?
-Mark
On Feb 22, 12:44 pm, Ceeram <c33...@gmail.com> wrote:
I worked some more on this. In many cases the count now returns correct results for the custom find. Jose also pointed out that with the count queries joins and other query params are not always wanted if it is a count operation even though it might return a correct count. I added $query['operation'] = 'count', so that the custom finder can distinguish the query to build, if wanted.
> Looks good to me. One concern I have is how we handle custom find > methods that add fields. We should make sure that modifying > query['fields'] doesn't cause the count operation to fail. Perhaps > adding a separate key to the query data to indicate its a count > operation?
> -Mark
> On Feb 22, 12:44 pm, Ceeram <c33...@gmail.com> wrote: > > Hey everyone,
> > I have looked a bit more into custom find methods.
> > The model constructor doesnt merge findMethods with those of Model when > > defining public $findMethods = array('custom' => true) in AppModel.
> > Also Pagination often returns incorrect count results, when paginating a > > custom find type.
> I worked some more on this. In many cases the count now returns correct results for the custom find. > Jose also pointed out that with the count queries joins and other query params are not always wanted if it is a count operation even though it might return a correct count. > I added $query['operation'] = 'count', so that the custom finder can distinguish the query to build, if wanted.
> Op woensdag 29 februari 2012 00:22:50 UTC+1 schreef mark_story het volgende: > Looks good to me. One concern I have is how we handle custom find > methods that add fields. We should make sure that modifying > query['fields'] doesn't cause the count operation to fail. Perhaps > adding a separate key to the query data to indicate its a count > operation?
> -Mark
> On Feb 22, 12:44 pm, Ceeram <c33...@gmail.com> wrote: > > Hey everyone,
> > I have looked a bit more into custom find methods.
> > The model constructor doesnt merge findMethods with those of Model when > > defining public $findMethods = array('custom' => true) in AppModel.
> > Also Pagination often returns incorrect count results, when paginating a > > custom find type.
Looks great, the extra operation key will be really useful for people
with custom finders, and lets them do all the hard work. I don't know
if you want to merge it into 2.1 or wait until the 2.2 branch gets
created.
-Mark
On Feb 29, 2:35 pm, Ceeram <c33...@gmail.com> wrote:
> I worked some more on this. In many cases the count now returns correct
> results for the custom find.
> Jose also pointed out that with the count queries joins and other query
> params are not always wanted if it is a count operation even though it
> might return a correct count.
> I added $query['operation'] = 'count', so that the custom finder can
> distinguish the query to build, if wanted.
> Op woensdag 29 februari 2012 00:22:50 UTC+1 schreef mark_story het volgende:
> > Looks good to me. One concern I have is how we handle custom find
> > methods that add fields. We should make sure that modifying
> > query['fields'] doesn't cause the count operation to fail. Perhaps
> > adding a separate key to the query data to indicate its a count
> > operation?
> > -Mark
> > On Feb 22, 12:44 pm, Ceeram <c33...@gmail.com> wrote:
> > > Hey everyone,
> > > I have looked a bit more into custom find methods.
> > > The model constructor doesnt merge findMethods with those of Model when
> > > defining public $findMethods = array('custom' => true) in AppModel.
> > > Also Pagination often returns incorrect count results, when paginating a
> > > custom find type.
I think the merge of findMethods can go into 2.1 The paginate changes i think would fit better in 2.2. I consider this being a bug, as it has not ever worked as it should. Probably many users created their workarounds for it, so i think it would be better to have this in the early stages of 2.2 perhaps as we are now too close to stable for this to be merged and perhaps break applications which run fine on current 2.1 branch.
Op donderdag 1 maart 2012 19:49:21 UTC+1 schreef mark_story het volgende:
> Looks great, the extra operation key will be really useful for people > with custom finders, and lets them do all the hard work. I don't know > if you want to merge it into 2.1 or wait until the 2.2 branch gets > created.
> -Mark
> On Feb 29, 2:35 pm, Ceeram <c33...@gmail.com> wrote: > > I worked some more on this. In many cases the count now returns correct > > results for the custom find. > > Jose also pointed out that with the count queries joins and other query > > params are not always wanted if it is a count operation even though it > > might return a correct count. > > I added $query['operation'] = 'count', so that the custom finder can > > distinguish the query to build, if wanted.
> > Op woensdag 29 februari 2012 00:22:50 UTC+1 schreef mark_story het > volgende:
> > > Looks good to me. One concern I have is how we handle custom find > > > methods that add fields. We should make sure that modifying > > > query['fields'] doesn't cause the count operation to fail. Perhaps > > > adding a separate key to the query data to indicate its a count > > > operation?
> > > -Mark
> > > On Feb 22, 12:44 pm, Ceeram <c33...@gmail.com> wrote: > > > > Hey everyone,
> > > > I have looked a bit more into custom find methods.
> > > > The model constructor doesnt merge findMethods with those of Model > when > > > > defining public $findMethods = array('custom' => true) in AppModel.
> > > > Also Pagination often returns incorrect count results, when > paginating a > > > > custom find type.