Skip to content

Commit

Permalink
table name auto add underscore if entity name consists of more than t…
Browse files Browse the repository at this point in the history
…wo word
  • Loading branch information
yuhuanbo committed Sep 11, 2013
1 parent 23fc4c5 commit 3218737
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion UltiSnips/php/symfony2.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3218737

Please sign in to comment.