| @@ -9,11 +9,23 @@ | ||
| 9 | 9 | * |
| 10 | 10 | * @since 1.7 |
| 11 | 11 | */ |
| 12 | 12 | class PLL_Cache { |
| 13 | - protected $blog_id, $cache; | |
| 13 | + /** | |
| 14 | + * Current site id. | |
| 15 | + * | |
| 16 | + * @var int | |
| 17 | + */ | |
| 18 | + protected $blog_id; | |
| 14 | 19 | |
| 15 | 20 | /** |
| 21 | + * The cache container. | |
| 22 | + * | |
| 23 | + * @var array | |
| 24 | + */ | |
| 25 | + protected $cache = array(); | |
| 26 | + | |
| 27 | + /** | |
| 16 | 28 | * Constructor |
| 17 | 29 | * |
| 18 | 30 | * @since 1.7 |
| 19 | 31 | */ |
| @@ -27,8 +39,9 @@ | ||
| 27 | 39 | * |
| 28 | 40 | * @since 1.7 |
| 29 | 41 | * |
| 30 | 42 | * @param int $new_blog |
| 43 | + * @return void | |
| 31 | 44 | */ |
| 32 | 45 | public function switch_blog( $new_blog ) { |
| 33 | 46 | $this->blog_id = $new_blog; |
| 34 | 47 | } |
| @@ -39,8 +52,9 @@ | ||
| 39 | 52 | * @since 1.7 |
| 40 | 53 | * |
| 41 | 54 | * @param string $key |
| 42 | 55 | * @param mixed $data |
| 56 | + * @return void | |
| 43 | 57 | */ |
| 44 | 58 | public function set( $key, $data ) { |
| 45 | 59 | $this->cache[ $this->blog_id ][ $key ] = $data; |
| 46 | 60 | } |
| @@ -62,8 +76,9 @@ | ||
| 62 | 76 | * |
| 63 | 77 | * @since 1.7 |
| 64 | 78 | * |
| 65 | 79 | * @param string $key |
| 80 | + * @return void | |
| 66 | 81 | */ |
| 67 | 82 | public function clean( $key = '' ) { |
| 68 | 83 | if ( empty( $key ) ) { |
| 69 | 84 | unset( $this->cache[ $this->blog_id ] ); |