Skip to content

Instantly share code, notes, and snippets.

@TomAdam
TomAdam / IdentityToEntityTransformer.php
Created March 30, 2015 17:29
Simple Entity Form Type
<?php
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
class IdentityToEntityTransformer implements DataTransformerInterface
{
private $repository;
private $repositoryMethod;
private $identifierMethod;
@barraponto
barraponto / git-submodule-rm.sh
Created April 25, 2012 16:36
git submodule-rm
#!/bin/bash
function actual_path() {
if [ [ -z "$1" ] -a [ -d $1 ] ]; then
echo $(cd $1 && test `pwd` = `pwd -P`)
return 0
else
return 1
fi
}