parent
adb886e09f
commit
e2a2145dad
@ -0,0 +1,160 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
namespace Chamilo\SkillBundle\Entity; |
||||
|
||||
use Gedmo\Mapping\Annotation as Gedmo; |
||||
use Doctrine\ORM\Mapping as ORM; |
||||
|
||||
/** |
||||
* Level |
||||
* |
||||
* @ORM\Table( |
||||
* name="skill_level", |
||||
* ) |
||||
* @ORM\Entity |
||||
*/ |
||||
class Level |
||||
{ |
||||
/** |
||||
* @var integer |
||||
* |
||||
* @ORM\Column(name="id", type="integer") |
||||
* @ORM\Id |
||||
* @ORM\GeneratedValue |
||||
*/ |
||||
protected $id; |
||||
|
||||
/** |
||||
* @var string |
||||
* |
||||
* @ORM\Column(name="name", type="string", length=255, nullable=false) |
||||
*/ |
||||
protected $name; |
||||
|
||||
/** |
||||
* @Gedmo\SortablePosition |
||||
* @ORM\Column(name="position", type="integer") |
||||
*/ |
||||
protected $position; |
||||
|
||||
/** |
||||
* @var string |
||||
* |
||||
* @ORM\Column(name="short_name", type="string", length=255, nullable=false) |
||||
*/ |
||||
protected $shortName; |
||||
|
||||
/** |
||||
* |
||||
* @Gedmo\SortableGroup |
||||
* @ORM\ManyToOne(targetEntity="Chamilo\SkillBundle\Entity\Profile", inversedBy="level") |
||||
* @ORM\JoinColumn(name="profile_id", referencedColumnName="id") |
||||
**/ |
||||
protected $profile; |
||||
|
||||
/** |
||||
* @return string |
||||
*/ |
||||
public function __toString() |
||||
{ |
||||
return (string) $this->getName(); |
||||
} |
||||
|
||||
/** |
||||
* @return int |
||||
*/ |
||||
public function getId() |
||||
{ |
||||
return $this->id; |
||||
} |
||||
|
||||
/** |
||||
* @param int $id |
||||
* @return Level |
||||
*/ |
||||
public function setId($id) |
||||
{ |
||||
$this->id = $id; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return string |
||||
*/ |
||||
public function getName() |
||||
{ |
||||
return $this->name; |
||||
} |
||||
|
||||
/** |
||||
* @param string $name |
||||
* @return Level |
||||
*/ |
||||
public function setName($name) |
||||
{ |
||||
$this->name = $name; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return mixed |
||||
*/ |
||||
public function getPosition() |
||||
{ |
||||
return $this->position; |
||||
} |
||||
|
||||
/** |
||||
* @param mixed $position |
||||
* @return Level |
||||
*/ |
||||
public function setPosition($position) |
||||
{ |
||||
$this->position = $position; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return mixed |
||||
*/ |
||||
public function getShortName() |
||||
{ |
||||
return $this->shortName; |
||||
} |
||||
|
||||
/** |
||||
* @param mixed $shortName |
||||
* @return Level |
||||
*/ |
||||
public function setShortName($shortName) |
||||
{ |
||||
$this->shortName = $shortName; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return Profile |
||||
*/ |
||||
public function getProfile() |
||||
{ |
||||
return $this->profile; |
||||
} |
||||
|
||||
/** |
||||
* @param mixed $profile |
||||
* @return Level |
||||
*/ |
||||
public function setProfile($profile) |
||||
{ |
||||
$this->profile = $profile; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,133 @@ |
||||
<?php |
||||
|
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
/** |
||||
* Profile Entity |
||||
* |
||||
* @package chamilo.skill |
||||
*/ |
||||
|
||||
namespace Chamilo\SkillBundle\Entity; |
||||
|
||||
use Doctrine\ORM\Mapping as ORM; |
||||
|
||||
/** |
||||
* Profile |
||||
* |
||||
* @ORM\Table( |
||||
* name="skill_level_profile", |
||||
* ) |
||||
* @ORM\Entity |
||||
*/ |
||||
class Profile |
||||
{ |
||||
/** |
||||
* @var integer |
||||
* |
||||
* @ORM\Column(name="id", type="integer") |
||||
* @ORM\Id |
||||
* @ORM\GeneratedValue |
||||
*/ |
||||
protected $id; |
||||
|
||||
/** |
||||
* @var string |
||||
* |
||||
* @ORM\Column(name="name", type="string", length=255, nullable=false) |
||||
*/ |
||||
protected $name; |
||||
|
||||
/** |
||||
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Skill", mappedBy="profile", cascade={"persist"}) |
||||
**/ |
||||
protected $skills; |
||||
|
||||
/** |
||||
* @ORM\OneToMany(targetEntity="Chamilo\SkillBundle\Entity\Level", mappedBy="profile", cascade={"persist"}) |
||||
* @ORM\OrderBy({"position" = "ASC"}) |
||||
**/ |
||||
protected $levels; |
||||
|
||||
public function __toString() |
||||
{ |
||||
return (string) $this->getName(); |
||||
} |
||||
|
||||
/** |
||||
* @return int |
||||
*/ |
||||
public function getId() |
||||
{ |
||||
return $this->id; |
||||
} |
||||
|
||||
/** |
||||
* @param int $id |
||||
* @return Profile |
||||
*/ |
||||
public function setId($id) |
||||
{ |
||||
$this->id = $id; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return string |
||||
*/ |
||||
public function getName() |
||||
{ |
||||
return $this->name; |
||||
} |
||||
|
||||
/** |
||||
* @param string $name |
||||
* @return Profile |
||||
*/ |
||||
public function setName($name) |
||||
{ |
||||
$this->name = $name; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return mixed |
||||
*/ |
||||
public function getSkills() |
||||
{ |
||||
return $this->skills; |
||||
} |
||||
|
||||
/** |
||||
* @param mixed $skills |
||||
* @return Profile |
||||
*/ |
||||
public function setSkills($skills) |
||||
{ |
||||
$this->skills = $skills; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return mixed |
||||
*/ |
||||
public function getLevels() |
||||
{ |
||||
return $this->levels; |
||||
} |
||||
|
||||
/** |
||||
* @param mixed $levels |
||||
* @return Profile |
||||
*/ |
||||
public function setLevels($levels) |
||||
{ |
||||
$this->levels = $levels; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue