Tuesday, December 20, 2011

Re: virtualfields + description cache

Did you try to set cacheSources to false in the model, as it has
cacheSources property?

On Dec 19, 5:48 pm, Janos Csikos <ja...@csikos.co.uk> wrote:
> Hi All,
>
> I have a problem with the description caching in datasource (CakePHP
> 1.3.12). Or maybe with my solution.
>
> My problem:
> I need to count a value based on other fields in the same table.
>
> My solution:
> I used the virtual fields for this. So let MySQL to work rather than
> count it in PHP. It is working and fine. I love the clean results.
>
> One of a new feature should give an option to the users to choose
> between the columns that used in the virtual fields.
> I've sorted this out, but later realised the description caching doesn't helps.
>
> So decided to turn of the description cache in the datasource
> (DataSource::__cacheDescription()), which dependent on the
> DataSource::cacheSources property (should be false).
>
> I expected the following code to do that in my actual model:
>
>         function __construct($id=false,$table=null,$ds=null) {
>                 parent::__construct($id,$table,$ds);
>                 $dbo = $this->getDataSource();
>                 $dbo->cacheSources = false;
>                 $dbo->cacheMethods = false;
>         }
>
> Actually this is not working. What I did wrong? Any comment could be
> helpful! Any other way to solve my problem?
>
> Many thanks,
>
> Janos

--
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