Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Custom find methods
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ceeram  
View profile  
 More options Feb 22 2012, 12:44 pm
From: Ceeram <c33...@gmail.com>
Date: Wed, 22 Feb 2012 09:44:35 -0800 (PST)
Local: Wed, Feb 22 2012 12:44 pm
Subject: Custom find methods

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 have addressed both issues here:

https://github.com/ceeram/cakephp/compare/2.1...2.1-findMethods

Id like to get your feedback on this.

Greetings Ceeram


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mark_story  
View profile  
 More options Feb 28 2012, 6:22 pm
From: mark_story <mark.st...@gmail.com>
Date: Tue, 28 Feb 2012 15:22:50 -0800 (PST)
Local: Tues, Feb 28 2012 6:22 pm
Subject: Re: Custom find methods
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ceeram  
View profile  
 More options Feb 29 2012, 2:35 pm
From: Ceeram <c33...@gmail.com>
Date: Wed, 29 Feb 2012 11:35:31 -0800 (PST)
Local: Wed, Feb 29 2012 2:35 pm
Subject: Re: Custom find methods

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.

All changes are now squashed into a single commit:
https://github.com/ceeram/cakephp/commit/7fd09cb53b2c7f191c46d7c11003...

Greetings Ceeram

Op woensdag 29 februari 2012 00:22:50 UTC+1 schreef mark_story het volgende:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
José Lorenzo Rodríguez  
View profile  
 More options Feb 29 2012, 2:58 pm
From: José Lorenzo Rodríguez <jose....@gmail.com>
Date: Wed, 29 Feb 2012 15:28:24 -0430
Local: Wed, Feb 29 2012 2:58 pm
Subject: Re: Custom find methods

Looks good to me, nice job!

On Feb 29, 2012, at 3:05 PM, Ceeram wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mark_story  
View profile  
 More options Mar 1 2012, 1:49 pm
From: mark_story <mark.st...@gmail.com>
Date: Thu, 1 Mar 2012 10:49:21 -0800 (PST)
Local: Thurs, Mar 1 2012 1:49 pm
Subject: Re: Custom find methods
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ceeram  
View profile  
 More options Mar 1 2012, 2:08 pm
From: Ceeram <c33...@gmail.com>
Date: Thu, 1 Mar 2012 11:08:46 -0800 (PST)
Local: Thurs, Mar 1 2012 2:08 pm
Subject: Re: Custom find methods

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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »