cphalcon
cphalcon copied to clipboard
NFR: cache for the aggregating Model methods
it would be great to have 'cache' functionality for the aggregate Model methods also. Or, if they are already in place, it would be good to mention them in the docs )). It is described here http://forum.phalconphp.com/discussion/2182/how-to-use-orm-cache-in-aggregate-methods-like-sum-count-etc- Shortly, 'count', 'sum', etc. model methods should be able to cache the resutls in exactly the same way as it works for 'find' and 'findAll', like this:
Items::count(["id<={$this->getId()}", 'cache' => ['lifetime' => 3600, 'key' => 'mykey']]);
Fixed in #2640