Tuesday, February 21, 2012

Re: Undefined index with associated afterFind()

Well my associations are:

Rate - hasManyProducts
Product - belongsTo Material, belongsTo Rate, hasAndBelongsToMany
Quote
Quote - belongsTo Product
Material - hasManyProducts

In QuotesController index function I have:

$quotes = $this->Quote->recursive = 2;
if ($this->Session->read('Auth.User.role') == 'admin') {
$this->set('quotes', $this->Quote->find('all'), $this->paginate());
}

Now I've also noticed that the database is queried twice for every
quote.

On Feb 16, 3:24 pm, jeremyharris <funeralm...@gmail.com> wrote:
> Let's see your model associations set up, where the afterFind is, and what
> find call you are using. That will probably give me a better understanding
> of what's going on.
>
> Also have you looked at virtual fields? They might be an answer to your
> problem.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate