forked from wrack/sublime.snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetsetstorage.sublime-snippet
48 lines (43 loc) · 1.22 KB
/
getsetstorage.sublime-snippet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<snippet>
<content><![CDATA[
/**
* @var \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage<$3>
* @TYPO3\\CMS\\Extbase\\Annotation\\ORM\\Lazy
*/
protected \$$1;
/**
* @return ObjectStorage
*/
public function get${1/(?:^|_)(\w)/\U$1$2/g$1}()${4:: ObjectStorage}
{
return \$this->${1/_(\w)/\U$1/g$1};
}
/**
* @param ObjectStorage \$${1/_(\w)/\U$1/g$1}
*/
public function set${1/(?:^|_)(\w)/\U$1$2/g$1}(ObjectStorage \$${1/_(\w)/\U$1/g$1})${5:: void}
{
\$this->${1/_(\w)/\U$1/g$1} = \$${1/_(\w)/\U$1/g$1};
}
/**
* @param $3 \$${2/_(\w)/\U$1/g$1}
*/
public function add${2/(?:^|_)(\w)/\U$1$2/g$1}($3 \$$2)${5:: void}
{
\$this->${1/_(\w)/\U$1/g$1}->attach(\$${2/_(\w)/\U$1/g$1});
}
/**
* @param $3 \$${2/_(\w)/\U$1/g$1}
*/
public function remove${2/(?:^|_)(\w)/\U$1$2/g$1}($3 \$${2/_(\w)/\U$1/g$1})${5:: void}
{
\$this->${1/_(\w)/\U$1/g$1}->detach(\$${2/_(\w)/\U$1/g$1});
}
]]></content>
<!-- Optional: Tab trigger to activate the snippet -->
<tabTrigger>gss</tabTrigger>
<!-- Optional: Scope the tab trigger will be active in -->
<scope>source.php</scope>
<!-- Optional: Description to show in the menu -->
<description>Create getter and setter methods for Storage Object</description>
</snippet>