Ok well if someFunction is getting the $id of being asked and the conditions
are getting the record where $id = Model.id and Model.user_id = Auth then is
that not checking? How is that different than read id then compare the data?

If there is no "match" with id and auth nothing is pulled correct... but
just forget the question all together I only added somefunction as a way to
represent me getting the $data it was not meant to be picked into parts and
turned into a huge deal. Just assume its either getting a record or not, was
what it was supposed to be not if auth id record are you using contain
caching queries 100 other million possibilities.

And I was asking how YOU YOU do it...put a snip of how YOU OR ANYONE OUT
THERE DOES IT. That was all. I thought it seemed pretty easy to ask "how do
you" I'm not asking if my way is correct as in "I have no clue please show
me how to tie my shoes"...im asking let me see how you do it so I can see
your way. Nothing to do with functions data records. Code.... how its
writted down. Step 1 you do what...step 2 then what......

But thanks anyways for giving the fingers a work out

-----Original Message-----
From: cricket [mailto:zijn.digi...@gmail.com] 
Sent: Wednesday, December 29, 2010 3:19 PM
To: cake-php@googlegroups.com
Subject: Re: Owner Check

On Wed, Dec 29, 2010 at 12:23 AM, Dave Maharaj <m...@davemaharaj.com> wrote:
>
> Because in the first example the $id will read from the db no matter what
as
> long as $id is passed and $id is in the db so your going to the db no
matter
> what and reading the data.
> In my way with $data = $this->Model->someFunction( $id,
> $this->Auth->User('id)); your only reading / finding / retrieving data if
> the conditions exist.
>
> In my head I think why pull the data if its not the owner with read? So
pull
> the data using a find and if anything is found then continue on with the
> request.

So how does this someFunction method magically tell you that the User
in question is the correct one? You have to pull the data from the DB
in any case. I don't think it's a big deal to pull it based on
Record.id and then check user_id. But, if you'd rather have both
conditions in the find() then there's no harm in that either.

Which is the *correct* way? I dunno.

Check out the new CakePHP Questions site http://cakeqs.org and help others
with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to