Resources: Add ResourceTag.php ResourceUserTag.php entities

pull/3451/head
Julio Montoya 4 years ago
parent 915f7f3268
commit c0831085a6
  1. 37
      src/CoreBundle/Entity/Resource/ResourceTag.php
  2. 36
      src/CoreBundle/Entity/Resource/ResourceUserTag.php

@ -0,0 +1,37 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity\Resource;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
/**
* @ORM\Entity
* @ORM\Table(name="resource_tag")
*/
class ResourceTag
{
use TimestampableEntity;
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", nullable=false)
*/
protected $name;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="resourceComments")
* @ORM\JoinColumn(name="author_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $author;
}

@ -0,0 +1,36 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Entity\Resource;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
/**
* @ORM\Entity
* @ORM\Table(name="resource_user_tag")
*/
class ResourceUserTag
{
use TimestampableEntity;
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="resourceTags")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $user;
/**
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceTag")
* @ORM\JoinColumn(name="tag_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $tag;
}
Loading…
Cancel
Save