|
@@ -37,6 +37,15 @@ class Session
|
|
|
const DRH = 1;
|
|
|
const COACH = 2;
|
|
|
|
|
|
+ /**
|
|
|
+ * @var int
|
|
|
+ *
|
|
|
+ * @ORM\Column(name="id", type="integer", nullable=false, unique=false)
|
|
|
+ * @ORM\Id
|
|
|
+ * @ORM\GeneratedValue(strategy="AUTO")
|
|
|
+ */
|
|
|
+ protected $id;
|
|
|
+
|
|
|
/**
|
|
|
* @var ArrayCollection
|
|
|
* @ORM\OneToMany(targetEntity="SessionRelCourse", mappedBy="session", cascade={"persist"}, orphanRemoval=true)
|
|
@@ -60,126 +69,117 @@ class Session
|
|
|
*/
|
|
|
protected $currentCourse;
|
|
|
|
|
|
- /**
|
|
|
- * @var int
|
|
|
- *
|
|
|
- * @ORM\Column(name="id", type="integer", nullable=false, unique=false)
|
|
|
- * @ORM\Id
|
|
|
- * @ORM\GeneratedValue(strategy="AUTO")
|
|
|
- */
|
|
|
- private $id;
|
|
|
-
|
|
|
/**
|
|
|
* @var string
|
|
|
*
|
|
|
* @ORM\Column(name="name", type="string", length=150, nullable=false, unique=false)
|
|
|
*/
|
|
|
- private $name;
|
|
|
+ protected $name;
|
|
|
|
|
|
/**
|
|
|
* @var string
|
|
|
*
|
|
|
* @ORM\Column(name="description", type="text", nullable=true, unique=false)
|
|
|
*/
|
|
|
- private $description;
|
|
|
+ protected $description;
|
|
|
|
|
|
/**
|
|
|
* @var bool
|
|
|
*
|
|
|
* @ORM\Column(name="show_description", type="boolean", nullable=true)
|
|
|
*/
|
|
|
- private $showDescription;
|
|
|
+ protected $showDescription;
|
|
|
|
|
|
/**
|
|
|
* @var int
|
|
|
*
|
|
|
* @ORM\Column(name="duration", type="integer", nullable=true)
|
|
|
*/
|
|
|
- private $duration;
|
|
|
+ protected $duration;
|
|
|
|
|
|
/**
|
|
|
* @var int
|
|
|
*
|
|
|
* @ORM\Column(name="nbr_courses", type="smallint", nullable=true, unique=false)
|
|
|
*/
|
|
|
- private $nbrCourses;
|
|
|
+ protected $nbrCourses;
|
|
|
|
|
|
/**
|
|
|
* @var int
|
|
|
*
|
|
|
* @ORM\Column(name="nbr_users", type="integer", nullable=true, unique=false)
|
|
|
*/
|
|
|
- private $nbrUsers;
|
|
|
+ protected $nbrUsers;
|
|
|
|
|
|
/**
|
|
|
* @var int
|
|
|
*
|
|
|
* @ORM\Column(name="nbr_classes", type="integer", nullable=true, unique=false)
|
|
|
*/
|
|
|
- private $nbrClasses;
|
|
|
+ protected $nbrClasses;
|
|
|
|
|
|
/**
|
|
|
* @var int
|
|
|
*
|
|
|
* @ORM\Column(name="session_admin_id", type="integer", nullable=true, unique=false)
|
|
|
*/
|
|
|
- private $sessionAdminId;
|
|
|
+ protected $sessionAdminId;
|
|
|
|
|
|
/**
|
|
|
* @var int
|
|
|
*
|
|
|
* @ORM\Column(name="visibility", type="integer", nullable=false, unique=false)
|
|
|
*/
|
|
|
- private $visibility;
|
|
|
+ protected $visibility;
|
|
|
|
|
|
/**
|
|
|
* @var int
|
|
|
*
|
|
|
* @ORM\Column(name="promotion_id", type="integer", nullable=true, unique=false)
|
|
|
*/
|
|
|
- private $promotionId;
|
|
|
+ protected $promotionId;
|
|
|
|
|
|
/**
|
|
|
* @var \DateTime
|
|
|
*
|
|
|
* @ORM\Column(name="display_start_date", type="datetime", nullable=true, unique=false)
|
|
|
*/
|
|
|
- private $displayStartDate;
|
|
|
+ protected $displayStartDate;
|
|
|
|
|
|
/**
|
|
|
* @var \DateTime
|
|
|
*
|
|
|
* @ORM\Column(name="display_end_date", type="datetime", nullable=true, unique=false)
|
|
|
*/
|
|
|
- private $displayEndDate;
|
|
|
+ protected $displayEndDate;
|
|
|
|
|
|
/**
|
|
|
* @var \DateTime
|
|
|
*
|
|
|
* @ORM\Column(name="access_start_date", type="datetime", nullable=true, unique=false)
|
|
|
*/
|
|
|
- private $accessStartDate;
|
|
|
+ protected $accessStartDate;
|
|
|
|
|
|
/**
|
|
|
* @var \DateTime
|
|
|
*
|
|
|
* @ORM\Column(name="access_end_date", type="datetime", nullable=true, unique=false)
|
|
|
*/
|
|
|
- private $accessEndDate;
|
|
|
+ protected $accessEndDate;
|
|
|
|
|
|
/**
|
|
|
* @var \DateTime
|
|
|
*
|
|
|
* @ORM\Column(name="coach_access_start_date", type="datetime", nullable=true, unique=false)
|
|
|
*/
|
|
|
- private $coachAccessStartDate;
|
|
|
+ protected $coachAccessStartDate;
|
|
|
|
|
|
/**
|
|
|
* @var \DateTime
|
|
|
*
|
|
|
* @ORM\Column(name="coach_access_end_date", type="datetime", nullable=true, unique=false)
|
|
|
*/
|
|
|
- private $coachAccessEndDate;
|
|
|
+ protected $coachAccessEndDate;
|
|
|
|
|
|
/**
|
|
|
* Only available when "session_list_order" setting is on.
|
|
@@ -188,36 +188,36 @@ class Session
|
|
|
*
|
|
|
* @ORM\Column(name="position", type="integer", nullable=false)
|
|
|
*/
|
|
|
- //private $position;
|
|
|
+ //protected $position;
|
|
|
|
|
|
/**
|
|
|
* @ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CItemProperty", mappedBy="session")
|
|
|
*/
|
|
|
- //private $items;
|
|
|
+ //protected $items;
|
|
|
|
|
|
/**
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", inversedBy="sessionAsGeneralCoach")
|
|
|
* @ORM\JoinColumn(name="id_coach", referencedColumnName="id")
|
|
|
*/
|
|
|
- private $generalCoach;
|
|
|
+ protected $generalCoach;
|
|
|
|
|
|
/**
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\SessionCategory", inversedBy="session")
|
|
|
* @ORM\JoinColumn(name="session_category_id", referencedColumnName="id")
|
|
|
*/
|
|
|
- private $category;
|
|
|
+ protected $category;
|
|
|
|
|
|
/**
|
|
|
* @var bool
|
|
|
* @ORM\Column(name="send_subscription_notification", type="boolean", nullable=false, options={"default":false})
|
|
|
*/
|
|
|
- private $sendSubscriptionNotification;
|
|
|
+ protected $sendSubscriptionNotification;
|
|
|
|
|
|
/**
|
|
|
* @var ArrayCollection
|
|
|
* @ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CStudentPublication", mappedBy="session", cascade={"persist"}, orphanRemoval=true)
|
|
|
*/
|
|
|
- private $studentPublications;
|
|
|
+ protected $studentPublications;
|
|
|
|
|
|
/**
|
|
|
* Constructor.
|
|
@@ -228,7 +228,6 @@ class Session
|
|
|
|
|
|
$this->nbrClasses = 0;
|
|
|
$this->nbrUsers = 0;
|
|
|
- $this->nbrUsers = 0;
|
|
|
|
|
|
$this->displayStartDate = new \DateTime();
|
|
|
$this->displayEndDate = new \DateTime();
|
|
@@ -359,11 +358,11 @@ class Session
|
|
|
{
|
|
|
if ($this->getUsers()->count()) {
|
|
|
$criteria = Criteria::create()->where(
|
|
|
- Criteria::expr()->eq("user", $subscription->getUser())
|
|
|
+ Criteria::expr()->eq('user', $subscription->getUser())
|
|
|
)->andWhere(
|
|
|
- Criteria::expr()->eq("session", $subscription->getSession())
|
|
|
+ Criteria::expr()->eq('session', $subscription->getSession())
|
|
|
)->andWhere(
|
|
|
- Criteria::expr()->eq("relationType", $subscription->getRelationType())
|
|
|
+ Criteria::expr()->eq('relationType', $subscription->getRelationType())
|
|
|
);
|
|
|
|
|
|
$relation = $this->getUsers()->matching($criteria);
|