Skip to content

Commit

Permalink
Updating API docs related to DboSource::$cacheMethods. Fixes #870
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jun 30, 2010
1 parent 735ac17 commit e023350
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions cake/libs/model/datasources/dbo_source.php
Expand Up @@ -53,7 +53,10 @@ class DboSource extends DataSource {
var $alias = 'AS '; var $alias = 'AS ';


/** /**
* Caches result from query parsing operations * Caches result from query parsing operations. Cached results for both DboSource::name() and
* DboSource::conditions() will be stored here. Method caching uses `crc32()` which is
* fast but can collisions more easily than other hashing algorithms. If you have problems
* with collisions, set DboSource::$cacheMethods to false.
* *
* @var array * @var array
* @access public * @access public
Expand Down Expand Up @@ -512,7 +515,12 @@ function cacheMethod($method, $key, $value = null) {
* Returns a quoted name of $data for use in an SQL statement. * Returns a quoted name of $data for use in an SQL statement.
* Strips fields out of SQL functions before quoting. * Strips fields out of SQL functions before quoting.
* *
* @param string $data * Results of this method are stored in a memory cache. This improves performance, but
* because the method uses a simple hashing algorithm it can infrequently have collisions.
* Setting DboSource::$cacheMethods to false will disable the memory cache.
*
* @param mixed $data Either a string with a column to quote. An array of columns to quote or an
* object from DboSource::expression() or DboSource::identifier()
* @return string SQL field * @return string SQL field
* @access public * @access public
*/ */
Expand Down Expand Up @@ -2050,6 +2058,10 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) {
* conditions are provided those conditions will be parsed and quoted. If a boolean * conditions are provided those conditions will be parsed and quoted. If a boolean
* is given it will be integer cast as condition. Null will return 1 = 1. * is given it will be integer cast as condition. Null will return 1 = 1.
* *
* Results of this method are stored in a memory cache. This improves performance, but
* because the method uses a simple hashing algorithm it can infrequently have collisions.
* Setting DboSource::$cacheMethods to false will disable the memory cache.
*
* @param mixed $conditions Array or string of conditions, or any value. * @param mixed $conditions Array or string of conditions, or any value.
* @param boolean $quoteValues If true, values should be quoted * @param boolean $quoteValues If true, values should be quoted
* @param boolean $where If true, "WHERE " will be prepended to the return value * @param boolean $where If true, "WHERE " will be prepended to the return value
Expand Down

0 comments on commit e023350

Please sign in to comment.