| @@ 2752-2766 (lines=15) @@ | ||
| 2749 | */ |
|
| 2750 | protected static function _create_cache_key($query, $parameters, $table_name = null, $connection_name = self::DEFAULT_CONNECTION) |
|
| 2751 | { |
|
| 2752 | if ( |
|
| 2753 | isset(static::$_config[$connection_name]['create_cache_key']) === true |
|
| 2754 | && |
|
| 2755 | is_callable(static::$_config[$connection_name]['create_cache_key']) === true |
|
| 2756 | ) { |
|
| 2757 | return call_user_func_array( |
|
| 2758 | static::$_config[$connection_name]['create_cache_key'], |
|
| 2759 | array( |
|
| 2760 | $query, |
|
| 2761 | $parameters, |
|
| 2762 | $table_name, |
|
| 2763 | $connection_name, |
|
| 2764 | ) |
|
| 2765 | ); |
|
| 2766 | } |
|
| 2767 | $parameter_string = implode(',', $parameters); |
|
| 2768 | $key = $query . ':' . $parameter_string; |
|
| 2769 | ||
| @@ 2818-2830 (lines=13) @@ | ||
| 2815 | // init |
|
| 2816 | static::$_query_cache = array(); |
|
| 2817 | ||
| 2818 | if ( |
|
| 2819 | isset(static::$_config[$connection_name]['clear_cache']) === true |
|
| 2820 | && |
|
| 2821 | is_callable(static::$_config[$connection_name]['clear_cache']) === true |
|
| 2822 | ) { |
|
| 2823 | return call_user_func_array( |
|
| 2824 | static::$_config[$connection_name]['clear_cache'], |
|
| 2825 | array( |
|
| 2826 | $table_name, |
|
| 2827 | $connection_name, |
|
| 2828 | ) |
|
| 2829 | ); |
|
| 2830 | } |
|
| 2831 | ||
| 2832 | return false; |
|
| 2833 | } |
|