commit
43764d5f67
@ -0,0 +1,118 @@ |
||||
<?php |
||||
|
||||
namespace Chamilo\CoreBundle\Entity; |
||||
|
||||
use Doctrine\ORM\Mapping as ORM; |
||||
|
||||
/** |
||||
* FieldRelTag |
||||
* |
||||
* @ORM\Table(name="extra_field_rel_tag") |
||||
* @ORM\Entity |
||||
*/ |
||||
class ExtraFieldRelTag |
||||
{ |
||||
/** |
||||
* @var integer |
||||
* |
||||
* @ORM\Column(name="field_id", type="integer", nullable=false) |
||||
*/ |
||||
private $fieldId; |
||||
|
||||
/** |
||||
* @var integer |
||||
* |
||||
* @ORM\Column(name="tag_id", type="integer", nullable=false) |
||||
*/ |
||||
private $tagId; |
||||
|
||||
/** |
||||
* @var integer |
||||
* |
||||
* @ORM\Column(name="item_id", type="integer", nullable=false) |
||||
*/ |
||||
private $itemId; |
||||
|
||||
/** |
||||
* @var integer |
||||
* |
||||
* @ORM\Column(name="id", type="integer") |
||||
* @ORM\Id |
||||
* @ORM\GeneratedValue(strategy="IDENTITY") |
||||
*/ |
||||
private $id; |
||||
|
||||
/** |
||||
* Set fieldId |
||||
* @param integer $fieldId |
||||
* @return \Chamilo\CoreBundle\Entity\ExtraFieldRelTag |
||||
*/ |
||||
public function setFieldId($fieldId) |
||||
{ |
||||
$this->fieldId = $fieldId; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* Set tagId |
||||
* @param integer $tagId |
||||
* @return \Chamilo\CoreBundle\Entity\ExtraFieldRelTag |
||||
*/ |
||||
public function setTagId($tagId) |
||||
{ |
||||
$this->tagId = $tagId; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* Set itemId |
||||
* @param integer $itemId |
||||
* @return \Chamilo\CoreBundle\Entity\ExtraFieldRelTag |
||||
*/ |
||||
public function setItemId($itemId) |
||||
{ |
||||
$this->itemId = $itemId; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* Get fieldId |
||||
* |
||||
* @return integer |
||||
*/ |
||||
public function getFieldId() |
||||
{ |
||||
return $this->fieldId; |
||||
} |
||||
|
||||
/** |
||||
* Get tagId |
||||
* @return integer |
||||
*/ |
||||
public function getTagId() |
||||
{ |
||||
return $this->tagId; |
||||
} |
||||
|
||||
/** |
||||
* Get itemId |
||||
* @return integer |
||||
*/ |
||||
public function getItemId() |
||||
{ |
||||
return $this->itemId; |
||||
} |
||||
|
||||
/** |
||||
* Get id |
||||
* @return integer |
||||
*/ |
||||
public function getId() |
||||
{ |
||||
return $this->id; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,68 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
namespace Chamilo\CoreBundle\Migrations\Schema\V110; |
||||
|
||||
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; |
||||
use Doctrine\DBAL\Schema\Schema; |
||||
use Doctrine\DBAL\Types\Type as TableColumnType; |
||||
|
||||
/** |
||||
* Session date changes |
||||
*/ |
||||
class Version20150608104600 extends AbstractMigrationChamilo |
||||
{ |
||||
/** |
||||
* @param Schema $schema |
||||
*/ |
||||
public function up(Schema $schema) |
||||
{ |
||||
$extraFieldRelTag = $schema->createTable('extra_field_rel_tag'); |
||||
$extraFieldRelTag->addColumn( |
||||
'id', |
||||
TableColumnType::INTEGER, |
||||
['unsigned' => true, 'autoincrement' => true, 'notnull' => true] |
||||
); |
||||
$extraFieldRelTag->addColumn( |
||||
'field_id', |
||||
TableColumnType::INTEGER, |
||||
['unsigned' => true, 'notnull' => true] |
||||
); |
||||
$extraFieldRelTag->addColumn( |
||||
'item_id', |
||||
TableColumnType::INTEGER, |
||||
['unsigned' => true, 'notnull' => true] |
||||
); |
||||
$extraFieldRelTag->addColumn( |
||||
'tag_id', |
||||
TableColumnType::INTEGER, |
||||
['unsigned' => true, 'notnull' => true] |
||||
); |
||||
$extraFieldRelTag->setPrimaryKey(['id']); |
||||
$extraFieldRelTag->addIndex( |
||||
['field_id'], |
||||
'idx_frt_field' |
||||
); |
||||
$extraFieldRelTag->addIndex( |
||||
['item_id'], |
||||
'idx_frt_item' |
||||
); |
||||
$extraFieldRelTag->addIndex( |
||||
['tag_id'], |
||||
'idx_frt_tag' |
||||
); |
||||
$extraFieldRelTag->addIndex( |
||||
['field_id', 'item_id', 'tag_id'], |
||||
'idx_frt_field_item_tag' |
||||
); |
||||
} |
||||
|
||||
/** |
||||
* @param Schema $schema |
||||
*/ |
||||
public function down(Schema $schema) |
||||
{ |
||||
$schema->dropTable('extra_field_rel_tag'); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue