Created
July 27, 2012 14:28
-
-
Save tristanbes/3188320 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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