-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
322 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Plafor\Models; | ||
use CodeIgniter\Model; | ||
|
||
class AcquisitionLevelModel extends Model{ | ||
|
||
protected $table='comment'; | ||
protected $primaryKey='id'; | ||
protected $allowedFields=['name']; | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
namespace Plafor\Models; | ||
use CodeIgniter\Database\ConnectionInterface; | ||
use CodeIgniter\Model; | ||
use CodeIgniter\Validation\ValidationInterface; | ||
|
||
class AcquisitionStatusModel extends Model{ | ||
|
||
protected $table='acquisition_status'; | ||
protected $primaryKey='id'; | ||
protected $allowedFields=['fk_objective','fk_user_course','fk_acquisition_level']; | ||
private ObjectiveModel $objectiveModel; | ||
private UserCourseModel $userCourseModel; | ||
private AcquisitionLevelModel $acquisitionLevelModel; | ||
|
||
public function __construct(ConnectionInterface &$db = null, ValidationInterface $validation = null) | ||
{ | ||
parent::__construct($db, $validation); | ||
} | ||
|
||
/** | ||
* @param $acquisitionStatut /the array obtained from this model | ||
* @return array | ||
*/ | ||
public function getObjective($acquisitionStatut){ | ||
$this->objectiveModel = new ObjectiveModel(); | ||
return $this->objectiveModel->find($acquisitionStatut['fk_objective']); | ||
|
||
} | ||
/** | ||
* @param $acquisitionStatut /the array obtained from this model | ||
* @return array | ||
*/ | ||
public function getUserCourse($acquisitionStatut){ | ||
$this->userCourseModel=new UserCourseModel(); | ||
return $this->userCourseModel->find($acquisitionStatut['fk_user_course']); | ||
|
||
} | ||
/** | ||
* @param $acquisitionStatut /the array obtained from this model | ||
* @return array | ||
*/ | ||
public function getAcquisitionLevel($acquisitionStatut){ | ||
if ($this->acquisitionLevelModel==null) | ||
$this->acquisitionLevelModel=new AcquisitionLevelModel(); | ||
return $this->acquisitionLevelModel->find($acquisitionStatut['fk_acquisition_level']); | ||
|
||
} | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace Plafor\Models; | ||
use CodeIgniter\Database\ConnectionInterface; | ||
use CodeIgniter\Model; | ||
use CodeIgniter\Validation\ValidationInterface; | ||
use User\Models\User_model; | ||
|
||
class CommentModel extends Model{ | ||
|
||
protected $table='comment'; | ||
protected $primaryKey='id'; | ||
protected $allowedFields=['fk_trainer','fk_acquisition_status','comment','date_creation']; | ||
private User_model $userModel; | ||
private AcquisitionStatusModel $acquisitionStatusModel; | ||
/**To do | ||
* Add method to get trainer and acquisition_status | ||
*/ | ||
public function __construct(ConnectionInterface &$db = null, ValidationInterface $validation = null) | ||
{ | ||
parent::__construct($db, $validation); | ||
|
||
|
||
} | ||
|
||
public function getTrainer($comment){ | ||
if ($this->userModel==null) | ||
$this->userModel=new User_model(); | ||
return $this->userModel->find($comment['fk_trainer']); | ||
} | ||
public function getAcquisitionStatus($comment){ | ||
$this->acquisitionStatusModel=new AcquisitionStatusModel(); | ||
return $this->acquisitionStatusModel->find($comment['fk_acquisition_status']); | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Plafor\Models; | ||
use CodeIgniter\Database\ConnectionInterface; | ||
use CodeIgniter\Model; | ||
use CodeIgniter\Validation\ValidationInterface; | ||
|
||
class CompetenceDomainModel extends Model{ | ||
|
||
protected $table='competence_domain'; | ||
protected $primaryKey='id'; | ||
protected $allowedFields=['fk_course_plan','symbol','name','archive']; | ||
protected $useSoftDeletes=true; | ||
protected $deletedField='archive'; | ||
private CoursePlanModel $coursePlanModel; | ||
/**To do | ||
* Add method to get course_plan | ||
*/ | ||
|
||
public function __construct(ConnectionInterface &$db = null, ValidationInterface $validation = null) | ||
{ | ||
parent::__construct($db, $validation); | ||
|
||
} | ||
|
||
public function getCoursePlan($competenceDomain){ | ||
if ($this->coursePlanModel==null) | ||
$this->coursePlanModel=new CoursePlanModel(); | ||
|
||
return $this->coursePlanModel->find($competenceDomain['fk_course_plan']); | ||
|
||
} | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
namespace Plafor\Models; | ||
|
||
use CodeIgniter\Model; | ||
|
||
class CoursePlanModel extends Model{ | ||
protected $table='course_plan'; | ||
protected $primaryKey='id'; | ||
protected $allowedFields=['formation_number','official_name','date_begin']; | ||
protected $useSoftDeletes=true; | ||
protected $deletedField='archive'; | ||
|
||
|
||
} | ||
|
||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
|
||
namespace Plafor\Models; | ||
|
||
|
||
use CodeIgniter\Database\ConnectionInterface; | ||
use CodeIgniter\Validation\ValidationInterface; | ||
|
||
class ObjectiveModel extends \CodeIgniter\Model | ||
{ | ||
protected $table='objective'; | ||
protected $primaryKey='id'; | ||
protected $allowedFields=['fk_operational_competence','symbol','taxonomy','name']; | ||
protected $useSoftDeletes=true; | ||
protected $deletedField='archive'; | ||
private OperationalCompetenceModel $operationalCompetenceModel; | ||
|
||
public function __construct(ConnectionInterface &$db = null, ValidationInterface $validation = null) | ||
{ | ||
parent::__construct($db, $validation); | ||
} | ||
public function getOperationalCompetence($objective){ | ||
if ($this->operationalCompetenceModel==null) | ||
$this->operationalCompetenceModel=new OperationalCompetenceModel(); | ||
return $this->operationalCompetenceModel->find($objective['fk_operational_competence']); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
|
||
namespace Plafor\Models; | ||
|
||
|
||
use CodeIgniter\Database\ConnectionInterface; | ||
use CodeIgniter\Validation\ValidationInterface; | ||
|
||
class OperationalCompetenceModel extends \CodeIgniter\Model | ||
{ | ||
protected $table='operational_competence'; | ||
protected $primaryKey='id'; | ||
protected $allowedFields=['fk_competence_domain','name','symbol','methodologic','social','personal']; | ||
protected $useSoftDeletes='true'; | ||
protected $deletedField='archive'; | ||
private CompetenceDomainModel $competenceDomainModel; | ||
public function __construct(ConnectionInterface &$db = null, ValidationInterface $validation = null) | ||
{ | ||
parent::__construct($db, $validation); | ||
} | ||
public function getCompetenceDomain($operationalCompetence){ | ||
if ($this->competenceDomainModel==null) | ||
$this->competenceDomainModel=new CompetenceDomainModel(); | ||
return $this->competenceDomainModel->find($operationalCompetence['fk_competence_domain']); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
|
||
namespace Plafor\Models; | ||
|
||
|
||
use CodeIgniter\Database\ConnectionInterface; | ||
use CodeIgniter\Validation\ValidationInterface; | ||
use User\Models\User_model; | ||
|
||
class TrainerApprenticeModel extends \CodeIgniter\Model | ||
{ | ||
protected $table='trainer_apprentice'; | ||
protected $primaryKey='id'; | ||
protected $allowedFields=['fk_trainer','fk_apprentice']; | ||
private User_model $userModel; | ||
public function __construct(ConnectionInterface &$db = null, ValidationInterface $validation = null) | ||
{ | ||
parent::__construct($db, $validation); | ||
} | ||
public function getTrainer($trainerApprentice){ | ||
if ($this->userModel==null) | ||
$this->userModel=new User_model(); | ||
return $this->userModel->find($trainerApprentice['fk_trainer']); | ||
} | ||
public Function getApprentice($trainerApprentice){ | ||
if ($this->userModel==null) | ||
$this->userModel=new User_model(); | ||
return $this->userModel->find($trainerApprentice['fk_apprentice']); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
|
||
namespace Plafor\Models; | ||
|
||
|
||
use CodeIgniter\Database\ConnectionInterface; | ||
use CodeIgniter\Validation\ValidationInterface; | ||
use User\Models\User_model; | ||
|
||
class UserCourseModel extends \CodeIgniter\Model | ||
{ | ||
protected $table='user_course'; | ||
protected $primaryKey='id'; | ||
protected $allowedFields=['fk_user','fk_course_plan','fk_status','date_begin','date_end']; | ||
private User_model $userModel; | ||
private CoursePlanModel $coursePlanModel; | ||
private AcquisitionStatusModel $acquisitionStatusModel; | ||
/** create function to get user, course plan and status */ | ||
public function __construct(ConnectionInterface &$db = null, ValidationInterface $validation = null) | ||
{ | ||
parent::__construct($db, $validation); | ||
|
||
} | ||
public function getUser($userCourse){ | ||
if ($this->userModel==null) | ||
$this->userModel=new User_model(); | ||
return $this->userModel->find($userCourse['fk_user']); | ||
} | ||
public function getCoursePlan($userCourse){ | ||
if ($this->coursePlanModel==null) | ||
$this->coursePlanModel=new CoursePlanModel(); | ||
return $this->coursePlanModel->find($userCourse['fk_course_plan']); | ||
} | ||
public function getStatut($userCourse){ | ||
if ($this->acquisitionStatusModel==null) | ||
$this->acquisitionStatusModel=new AcquisitionStatusModel(); | ||
return $this->acquisitionStatusModel->find($userCourse['fk_status']); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
|
||
namespace Plafor\Models; | ||
|
||
|
||
class UserCourseStatusModel extends \CodeIgniter\Model | ||
{ | ||
protected $table='user_course_status'; | ||
protected $primaryKey='id'; | ||
protected $allowedFields=['name']; | ||
} |