You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
138 lines
2.3 KiB
138 lines
2.3 KiB
<?php
|
|
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
namespace Chamilo\CoreBundle\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* Class SequenceResource.
|
|
*
|
|
* @ORM\Entity(repositoryClass="Chamilo\CoreBundle\Repository\SequenceResourceRepository")
|
|
* @ORM\Table(name="sequence_resource")
|
|
*/
|
|
class SequenceResource
|
|
{
|
|
public const COURSE_TYPE = 1;
|
|
public const SESSION_TYPE = 2;
|
|
|
|
/**
|
|
* @var int
|
|
*
|
|
* @ORM\Column(name="id", type="integer")
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue()
|
|
*/
|
|
protected $id;
|
|
|
|
/**
|
|
* @var Sequence
|
|
*
|
|
* @ORM\ManyToOne(targetEntity="Sequence")
|
|
* @ORM\JoinColumn(name="sequence_id", referencedColumnName="id")
|
|
*/
|
|
protected $sequence;
|
|
|
|
/**
|
|
* @var int
|
|
*
|
|
* @ORM\Column(name="type", type="integer")
|
|
*/
|
|
protected $type;
|
|
|
|
/**
|
|
* @var int
|
|
*
|
|
* @ORM\Column(name="resource_id", type="integer")
|
|
*/
|
|
protected $resourceId;
|
|
|
|
/**
|
|
* Get id.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getId()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getType()
|
|
{
|
|
return $this->type;
|
|
}
|
|
|
|
/**
|
|
* Set the integer type.
|
|
*
|
|
* @param int $type
|
|
*
|
|
* @return SequenceResource
|
|
*/
|
|
public function setType($type)
|
|
{
|
|
$this->type = $type;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getGraph()
|
|
{
|
|
return $this->getSequence()->getGraph();
|
|
}
|
|
|
|
/**
|
|
* @return bool
|
|
*/
|
|
public function hasGraph()
|
|
{
|
|
$graph = $this->getSequence()->getGraph();
|
|
|
|
return !empty($graph) ? true : false;
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getResourceId()
|
|
{
|
|
return $this->resourceId;
|
|
}
|
|
|
|
/**
|
|
* @param int $resourceId
|
|
*
|
|
* @return $this
|
|
*/
|
|
public function setResourceId($resourceId)
|
|
{
|
|
$this->resourceId = $resourceId;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Sequence
|
|
*/
|
|
public function getSequence()
|
|
{
|
|
return $this->sequence;
|
|
}
|
|
|
|
/**
|
|
* @return $this
|
|
*/
|
|
public function setSequence(Sequence $sequence)
|
|
{
|
|
$this->sequence = $sequence;
|
|
|
|
return $this;
|
|
}
|
|
}
|
|
|