Merge pull request #272 from chrisyue/master

add symfony2 doctrine entity template
This commit is contained in:
Honza Pokorny 2013-08-31 11:11:52 -07:00
commit 2ab7f91dc4

View File

@ -153,3 +153,32 @@ snip.rv = re.match(r'.*(?=\.)', fn).group()
}
}
endsnippet
snippet ent "symfony2 doctrine entity" b
namespace `!p
abspath = os.path.abspath(path)
m = re.search(r'[A-Z].+(?=/)', abspath)
if m:
snip.rv = m.group().replace('/', '\\')
`;
use Doctrine\ORM\Mapping as ORM;
/**
* ${3:@author `whoami`}${4}
*
* @ORM\Entity()
* @ORM\Table(name="`!p snip.rv = re.match(r'.*(?=\.)', fn).group().lower()`")
*/
class `!p
snip.rv = re.match(r'.*(?=\.)', fn).group()
`
{
/**
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
* @ORM\Id
*/
private $id;
}
endsnippet