Created
March 7, 2014 11:04
-
-
Save rvanlaak/9409592 to your computer and use it in GitHub Desktop.
FpnTaggingBundle complete entities. The getters/setters are inherited via the parents
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 Acme\AppBundle\Entity\Tag; | |
use FPN\TagBundle\Entity\Tag as BaseTag; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* @ORM\Table(name="acme_tag") | |
* @ORM\Entity(repositoryClass="Acme\AppBundle\Entity\Tag\TagRepository") | |
*/ | |
class Tag extends BaseTag | |
{ | |
/** | |
* @var integer $id | |
* | |
* @ORM\Column(name="id", type="integer") | |
* @ORM\Id | |
* @ORM\GeneratedValue(strategy="AUTO") | |
*/ | |
protected $id; | |
/** | |
* @var string | |
* @ORM\Column(name="name", type="string", length=50) | |
*/ | |
protected $name; | |
/** | |
* @var string | |
* @ORM\Column(name="slug", type="string", length=50) | |
*/ | |
protected $slug; | |
/** | |
* @var \DateTime | |
* @ORM\Column(name="created_at", type="datetime") | |
*/ | |
protected $createdAt; | |
/** | |
* @var \DateTime | |
* @ORM\Column(name="updated_at", type="datetime") | |
*/ | |
protected $updatedAt; | |
/** | |
* @ORM\OneToMany(targetEntity="Acme\AppBundle\Entity\Tag\Tagging", mappedBy="tag", fetch="EAGER") | |
**/ | |
protected $tagging; | |
} |
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 Acme\AppBundle\Entity\Tag; | |
use FPN\TagBundle\Entity\Tagging as BaseTagging; | |
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\ORM\Mapping\UniqueConstraint; | |
/** | |
* @ORM\Table(name="acme_tagging", | |
* uniqueConstraints={@UniqueConstraint(name="tagging_idx", columns={"tag_id", "resource_type", "resource_id"})} | |
* ) | |
* @ORM\Entity | |
*/ | |
class Tagging extends BaseTagging | |
{ | |
/** | |
* @var integer $id | |
* | |
* @ORM\Column(name="id", type="integer") | |
* @ORM\Id | |
* @ORM\GeneratedValue(strategy="AUTO") | |
*/ | |
protected $id; | |
/** | |
* @ORM\ManyToOne(targetEntity="Acme\AppBundle\Entity\Tag\Tag", inversedBy="tagging")) | |
* @ORM\JoinColumn(name="tag_id", referencedColumnName="id") | |
**/ | |
protected $tag; | |
/** | |
* @var string | |
* @ORM\Column(name="resource_type", type="string", length=50) | |
*/ | |
protected $resourceType; | |
/** | |
* @var string | |
* @ORM\Column(name="resource_id", type="string", length=50) | |
*/ | |
protected $resourceId; | |
/** | |
* @var \DateTime | |
* @ORM\Column(name="created_at", type="datetime") | |
*/ | |
protected $createdAt; | |
/** | |
* @var \DateTime | |
* @ORM\Column(name="updated_at", type="datetime") | |
*/ | |
protected $updatedAt; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment