Skip to content

Instantly share code, notes, and snippets.

@tristanbes
Created July 27, 2012 14:28
Show Gist options
  • Save tristanbes/3188320 to your computer and use it in GitHub Desktop.
Save tristanbes/3188320 to your computer and use it in GitHub Desktop.
<?php
namespace AwesomeNamespace\AwesomeBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation;
/**
* @ORM\Entity
* @ORM\Table(name="profile_translations",
* uniqueConstraints={@ORM\UniqueConstraint(name="lookup_unique_idx", columns={
* "locale", "object_id", "field"
* })}
* )
*/
class ProfileTranslation extends AbstractPersonalTranslation
{
/**
* Convinient constructor
*
* @param string $locale
* @param string $field
* @param string $content
*/
public function __construct($locale = null, $field = null, $content = null)
{
$this->setLocale($locale);
$this->setField($field);
$this->setContent($content);
}
/**
* @ORM\ManyToOne(targetEntity="Profile", inversedBy="translations")
* @ORM\JoinColumn(name="object_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected $object;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment