Skip to content

Commit 8f11592

Browse files
author
Steven Oliver
committed
Merge pull request #276 from chrisyue/master
table name auto add underscore if entity name consists of more than two ...
2 parents 23fc4c5 + 3218737 commit 8f11592

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

UltiSnips/php/symfony2.snippets

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,11 @@ use Doctrine\ORM\Mapping as ORM;
169169
* ${3:@author `whoami`}
170170
*
171171
* @ORM\Entity()
172-
* @ORM\Table(name="`!p snip.rv = re.match(r'.*(?=\.)', fn).group().lower()`")
172+
* @ORM\Table(name="`!p
173+
tmp = re.match(r'.*(?=\.)', fn).group()
174+
tmp = re.sub(r'\B([A-Z])', r'_\1', tmp)
175+
snip.rv = tmp.lower()
176+
`")
173177
*/
174178
class `!p
175179
snip.rv = re.match(r'.*(?=\.)', fn).group()

0 commit comments

Comments
 (0)