From 3218737414848c81facbcade5086f7f2ac3d8b36 Mon Sep 17 00:00:00 2001 From: yuhuanbo Date: Wed, 11 Sep 2013 19:20:03 +0800 Subject: [PATCH] table name auto add underscore if entity name consists of more than two word --- UltiSnips/php/symfony2.snippets | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/UltiSnips/php/symfony2.snippets b/UltiSnips/php/symfony2.snippets index 5f47ce4..8fba46b 100644 --- a/UltiSnips/php/symfony2.snippets +++ b/UltiSnips/php/symfony2.snippets @@ -169,7 +169,11 @@ use Doctrine\ORM\Mapping as ORM; * ${3:@author `whoami`} * * @ORM\Entity() - * @ORM\Table(name="`!p snip.rv = re.match(r'.*(?=\.)', fn).group().lower()`") + * @ORM\Table(name="`!p +tmp = re.match(r'.*(?=\.)', fn).group() +tmp = re.sub(r'\B([A-Z])', r'_\1', tmp) +snip.rv = tmp.lower() +`") */ class `!p snip.rv = re.match(r'.*(?=\.)', fn).group()