Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7842315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:17:31+00:00 2026-06-02T16:17:31+00:00

I am using cakephp2. I have two questions I want to store different cache

  • 0

I am using cakephp2. I have two questions

  1. I want to store different cache counts in a separate table. For ex:- user may creates groups, forums etc and I want to store the count instead of querying each time. So I used the counterCache feature of cakephp. Is it possible to store all these counts in a separate table and when the user creates groups/forums etc should update the respective count in that table ?

  2. I need to update counterCache count for the groups in such a way that count should be incremented automatically when the user creates a group as well as the user joins in any group. Is it possible in cakephp ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:17:32+00:00Added an answer on June 2, 2026 at 4:17 pm

    No, counterCache() was not thought to work with more complex requirements like yours, it is, as any feature in the framework, thought to cover the most common cases. Yours is not an everyday request. 😉

    Use the afterSave() callback in the model and add your customized logic there and save the counts to the associated models as you need. But overall I don’t see a reason to add a single table just to store the counts? I don’t see any benefit in this architecture.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using cakephp, I have a generic address table, which I want to link to
Im using cakephp 2.0 and i have data submitted that i want to cleanup,
I have a PHP application using CakePHP. I need to present a table showing
I am using CakePHP 1.3. I have a few questions regarding CakePHP Models: 1)
I'm using cakephp, I have a model comment with two fields : model_type and
On my local setup I have a load of different CakePHP websites. I'm using
I have two tables user and location user has id(primary) and location fields/columns location
I have a cakePHP application that is pulling data from two different databases, which
I have using cakephp and I want to obscure all numbers which is more
I have two model News and Category. And they have habtm relation. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.