diff options
Diffstat (limited to 'template/php')
-rw-r--r-- | template/php/snip-getter-setter.php | 15 | ||||
-rw-r--r-- | template/php/snip-getter.php | 7 |
2 files changed, 22 insertions, 0 deletions
diff --git a/template/php/snip-getter-setter.php b/template/php/snip-getter-setter.php new file mode 100644 index 0000000..a3ab7c4 --- /dev/null +++ b/template/php/snip-getter-setter.php @@ -0,0 +1,15 @@ +/** + * get {{_input_:name}} + * @return {{_var_:name}} + */ +public {{_var_:name}} get{{_expr_:substitute('{{_var_:name}}', '\w\+', '\u\0', '')}}() { + return {{_var_:name}}; +} + +/** + * set {{_var_:name}} + * @param {{_var_:name}} + */ +public void set{{_expr_:substitute('{{_var_:name}}', '\w\+', '\u\0', '')}}({{_var_:name}} {{_var_:name}}) { + this.{{_var_:name}} = {{_var_:name}}; +} diff --git a/template/php/snip-getter.php b/template/php/snip-getter.php new file mode 100644 index 0000000..b27b2ea --- /dev/null +++ b/template/php/snip-getter.php @@ -0,0 +1,7 @@ +/** + * get {{_input_:name}} + * @return {{_var_:name}} + */ +public {{_input_:type}} get{{_expr_:substitute('{{_var_:name}}', '\w\+', '\u\0', '')}}() { + return {{_var_:name}}; +} |