PluginProbe
CSS & JavaScript Toolbox / 11.2
CSS & JavaScript Toolbox v11.2
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
css-javascript-toolbox / framework / ServicesFW / Storage.abstract.php

Storage.abstract.php in CSS & JavaScript Toolbox 11.2, at framework/ServicesFW/Storage.abstract.php

69 lines 971 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 */
5
6 /**
7 *
8 */
9 class CJTServicesStorage {
10
11 /**
12 * put your comment there...
13 *
14 * @var mixed
15 */
16 private $storageVarName;
17
18 /**
19 * put your comment there...
20 *
21 * @var mixed
22 */
23 private $value;
24
25 /**
26 * put your comment there...
27 *
28 * @param mixed $name
29 * @param mixed $default
30 */
31 public function __construct($name, $default = null) {
32 # Storage Wordpress option name
33 $this->storageVarName = strtolower( $name );
34 # Read
35 $this->value = get_option( $this->storageVarName, $default );
36 }
37
38 /**
39 * put your comment there...
40 *
41 */
42 public function & getValue() {
43 return $this->value;
44 }
45
46 /**
47 * put your comment there...
48 *
49 * @param mixed $value
50 */
51 public function & setValue($value) {
52 # Set value
53 $this->value =& $value;
54 # chain
55 return $this;
56 }
57
58 /**
59 * put your comment there...
60 *
61 */
62 public function & update() {
63 # Update DB Value
64 update_option( $this->storageVarName, $this->value );
65 # Chain
66 return $this;
67 }
68
69 }