| @@ 2651-2665 (lines=15) @@ | ||
| 2648 | */ |
|
| 2649 | protected static function _create_cache_key($query, $parameters, $table_name = null, $connection_name = self::DEFAULT_CONNECTION) |
|
| 2650 | { |
|
| 2651 | if ( |
|
| 2652 | isset(static::$_config[$connection_name]['create_cache_key']) === true |
|
| 2653 | && |
|
| 2654 | is_callable(static::$_config[$connection_name]['create_cache_key']) === true |
|
| 2655 | ) { |
|
| 2656 | return call_user_func_array( |
|
| 2657 | static::$_config[$connection_name]['create_cache_key'], |
|
| 2658 | array( |
|
| 2659 | $query, |
|
| 2660 | $parameters, |
|
| 2661 | $table_name, |
|
| 2662 | $connection_name, |
|
| 2663 | ) |
|
| 2664 | ); |
|
| 2665 | } |
|
| 2666 | $parameter_string = implode(',', $parameters); |
|
| 2667 | $key = $query . ':' . $parameter_string; |
|
| 2668 | ||
| @@ 2717-2729 (lines=13) @@ | ||
| 2714 | // init |
|
| 2715 | static::$_query_cache = array(); |
|
| 2716 | ||
| 2717 | if ( |
|
| 2718 | isset(static::$_config[$connection_name]['clear_cache']) === true |
|
| 2719 | && |
|
| 2720 | is_callable(static::$_config[$connection_name]['clear_cache']) === true |
|
| 2721 | ) { |
|
| 2722 | return call_user_func_array( |
|
| 2723 | static::$_config[$connection_name]['clear_cache'], |
|
| 2724 | array( |
|
| 2725 | $table_name, |
|
| 2726 | $connection_name, |
|
| 2727 | ) |
|
| 2728 | ); |
|
| 2729 | } |
|
| 2730 | ||
| 2731 | return false; |
|
| 2732 | } |
|