Skip to content

Instantly share code, notes, and snippets.

View cazzoo's full-sized avatar

caz cazzoo

  • France
View GitHub Profile
@cazzoo
cazzoo / Championship.php
Last active November 5, 2015 13:54
Cascade operations
<?php
class Championship
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @Groups({"id", "api"})
*/
@cazzoo
cazzoo / EntityToIntTransformer.php
Created August 12, 2015 08:38
StringToFileConverter.php
<?php
namespace RFC\CoreBundle\Form\DataTransformer;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Doctrine\Common\Persistence\ObjectManager;
class EntityToIntTransformer implements DataTransformerInterface
{
<?php
namespace RFC\CoreBundle\Entity;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @Gedmo\Uploadable(path="uploads/", callback="postUploadAction", filenameGenerator="SHA1", allowOverwrite=true)
@cazzoo
cazzoo / Descriptor.php
Last active August 29, 2015 14:26
Uploadable entities as entity collection
<?php
namespace RFC\CoreBundle\Entity;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use JMS\Serializer\Annotation\Groups;