Example #1
0
 public function insert($data)
 {
     try {
         parent::insert($data);
     } catch (\DibiException $e) {
     }
 }
Example #2
0
 public function __construct(\DibiConnection $connection, \Nette\Security\User $user)
 {
     parent::__construct($connection, "sch_class");
     $this->getSelection()->removeClause("SELECT");
     $this->getSelection()->select("sch_class.*, user.firstname AS teacher_firstname, user.lastname AS teacher_lastname, COUNT(sch_student.user_id) as students")->leftJoin("user")->on("sch_class.teacher_id = user.id")->leftJoin("sch_student")->on("sch_class.id = sch_student.class_id")->groupBy("sch_class.id");
     $this->setPrimaryKey("sch_class.id");
 }
Example #3
0
 public function __construct(\DibiConnection $connection, \Nette\Security\User $user)
 {
     parent::__construct($connection, "sch_group_membership");
     $this->getSelection()->removeClause("SELECT");
     $this->getSelection()->select("user.*, user_id AS user_id")->join("user")->on("sch_group_membership.user_id = user.id");
     $this->setPrimaryKey("sch_group_membership.user_id");
 }
Example #4
0
 public function __construct(\DibiConnection $connection, \Nette\Security\User $user)
 {
     parent::__construct($connection, "sch_load");
     $this->getSelection()->removeClause("SELECT");
     $this->getSelection()->select("sch_load.*, sch_subject.name AS subject_name, sch_group.name AS group_name, user.firstname AS teacher_firstname, user.lastname AS teacher_lastname, sch_class.shortname AS class_name, user.id AS user_id")->leftJoin("sch_subject")->on("sch_load.sch_subject_id = sch_subject.id")->leftJoin("sch_group")->on("sch_load.sch_group_id = sch_group.id")->leftJoin("sch_teacher")->on("sch_load.sch_teacher_id = sch_teacher.user_id")->leftJoin("user")->on("sch_teacher.user_id = user.id")->leftJoin("sch_class")->on("sch_group.sch_class_id = sch_class.id");
     $this->setPrimaryKey("sch_load.id");
 }
Example #5
0
 public function __construct(\DibiConnection $connection)
 {
     parent::__construct($connection, "wrk_work");
     $this->getSelection()->removeClause("SELECT");
     $this->getSelection()->select("wrk_work.*, user.firstname, user.lastname, wrk_set.name as set_name")->leftJoin("user")->on("wrk_work.user_id = user.id")->leftJoin("wrk_set")->on("wrk_work.wrk_set_id = wrk_set.id");
     $this->setPrimaryKey("wrk_work.id");
 }
Example #6
0
 public function __construct(\DibiConnection $connection)
 {
     parent::__construct($connection, "wrk_assignment");
     $this->getSelection()->removeClause("SELECT");
     $this->getSelection()->select("wrk_assignment.*, user.firstname, user.lastname, count(wrk_work.id) as works")->leftJoin("user")->on("wrk_assignment.user_id = user.id")->leftJoin("wrk_work")->on("wrk_assignment.id = wrk_work.wrk_assignment_id")->groupBy("wrk_assignment.id");
     $this->setPrimaryKey("wrk_assignment.id");
 }
Example #7
0
 public function __construct(\DibiConnection $connection, \Nette\Security\User $user)
 {
     parent::__construct($connection, "sch_subject");
     $this->getSelection()->removeClause("SELECT");
     $this->getSelection()->select("sch_subject.*,SUM(hours) AS hours")->leftJoin("sch_load")->on("sch_load.sch_subject_id = sch_subject.id")->groupBy("sch_subject.id");
     $this->setPrimaryKey("sch_subject.id");
 }
Example #8
0
 public function __construct(\DibiConnection $connection, \Nette\Security\User $user)
 {
     parent::__construct($connection, "sch_group");
     $this->getSelection()->removeClause("SELECT");
     $this->getSelection()->select("sch_group.*, sch_class.shortname AS class, count(user_id) AS members")->join("sch_class")->on("sch_group.sch_class_id = sch_class.id")->leftJoin("sch_group_membership")->on("sch_group_membership.sch_group_id = sch_group.id")->groupBy("sch_group.id");
     $this->setPrimaryKey("sch_group.id");
 }
Example #9
0
 public function __construct(\DibiConnection $connection, \Nette\Security\User $user)
 {
     parent::__construct($connection, "sch_teacher");
     $this->getSelection()->removeClause("SELECT");
     $this->getSelection()->select("sch_teacher.*, user.firstname, user.lastname, user.title, user.title_after, user.email, user.phone, user.gender, SUM(sch_load.hours) AS hours")->join("user")->on("sch_teacher.user_id = user.id")->leftJoin("sch_load")->on("sch_load.sch_teacher_id = sch_teacher.user_id")->groupBy("sch_teacher.user_id");
     $this->setPrimaryKey("sch_teacher.user_id");
 }
Example #10
0
 public function __construct(\DibiConnection $connection, \Nette\Security\User $user)
 {
     parent::__construct($connection, "sch_student");
     $this->getSelection()->removeClause("SELECT");
     $this->getSelection()->select("sch_student.*, user.firstname, user.lastname, user.title, user.title_after, user.email, user.phone, user.gender, sch_class.shortname AS class")->join("user")->on("sch_student.user_id = user.id")->leftJoin("sch_class")->on("sch_student.class_id = sch_class.id");
     $this->setPrimaryKey("sch_student.user_id");
 }
Example #11
0
 public function __construct(\DibiConnection $connection)
 {
     //odpoved je ve WorksPresenter - model je treba model->getSomeSelection($id);
     parent::__construct($connection, "act_works");
     $this->getSelection()->removeClause("SELECT");
     $this->getSelection()->select("act_works.*, user.firstname as fn, user.lastname as ln, group.name as pk")->leftJoin("user")->on("act_works.user_id = user.id")->leftJoin("group")->on("act_works.act_notebooks_id = group.id")->where("group.pk = ?", 1)->groupBy("act_works.id");
     $this->setPrimaryKey("act_works.id");
     $this->pkGroups = $this->getWorksPkHead();
 }
Example #12
0
 public function __construct(\DibiConnection $connection)
 {
     parent::__construct($connection, "wrk_set");
 }