We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7cef242 + 5386637 commit 2ab7f91Copy full SHA for 2ab7f91
UltiSnips/php/symfony2.snippets
@@ -153,3 +153,32 @@ snip.rv = re.match(r'.*(?=\.)', fn).group()
153
}
154
155
endsnippet
156
+
157
+snippet ent "symfony2 doctrine entity" b
158
+namespace `!p
159
+abspath = os.path.abspath(path)
160
+m = re.search(r'[A-Z].+(?=/)', abspath)
161
+if m:
162
+ snip.rv = m.group().replace('/', '\\')
163
+`;
164
165
+use Doctrine\ORM\Mapping as ORM;
166
167
+/**
168
+ * ${3:@author `whoami`}${4}
169
+ *
170
+ * @ORM\Entity()
171
+ * @ORM\Table(name="`!p snip.rv = re.match(r'.*(?=\.)', fn).group().lower()`")
172
+ */
173
+class `!p
174
+snip.rv = re.match(r'.*(?=\.)', fn).group()
175
+`
176
+{
177
+ /**
178
+ * @ORM\Column(type="integer")
179
+ * @ORM\GeneratedValue
180
+ * @ORM\Id
181
182
+ private $id;
183
+}
184
+endsnippet
0 commit comments