Skip to content

Instantly share code, notes, and snippets.

View tristanbes's full-sized avatar

Tristan Bessoussa tristanbes

View GitHub Profile
<?php
namespace AwesomeNamespace\AwesomeBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
/**
* Profile Admin
<?php
namespace AwesomeNamespace\AwesomeBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation;
/**
* @ORM\Entity
* @ORM\Table(name="profile_translations",
<?php
namespace AwesomeNamespace\AwesomeBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* AwesomeNamespace\AwesomeBundle\Entity\Profile
curl -s http://php-osx.liip.ch/install.sh | bash -s 5.4
Failed loading xdebug.so: dlopen(xdebug.so, 9): image not found
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/zend/lib/php_extensions/xdebug.so' -
dlopen(/usr/local/zend/lib/php_extensions/xdebug.so, 9): no suitable image found.
Did find: /usr/local/zend/lib/php_extensions/xdebug.so: mach-o, but wrong architecture in Unknown on line 0
<?php
[...]
class Car
{
/**
* @ORM\OneToMany(targetEntity="Condition", mappedBy="Car", cascade={"all"}, orphanRemoval=true)
*/
private $conditions;
@tristanbes
tristanbes / Condition.php
Created May 22, 2012 15:11
The form's client data is expected to be of type scalar, but is an instance of class Doctrine\ORM\PersistentCollection
<?php
namespace GamerCertified\TeamBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* GamerCertified\TeamBundle\Entity\Conditions
*
* @ORM\Table(name="conditions")
@tristanbes
tristanbes / Book.php
Created March 19, 2012 15:29
How to dynamically add translations to your I18N object using SonataAdminBundle & DoctrineExtensions
<?php
namespace Demo\BookBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* Demo\BookBundle\Entity\Book