crm/Prestudent_model, education/Lehrveransaltung_mode, person/Person_model: models are loaded in constructor to avoid multiple load

This commit is contained in:
alex
2019-09-06 15:49:47 +02:00
parent be91fc93c0
commit 5255e6166d
3 changed files with 8 additions and 12 deletions
+2 -4
View File
@@ -10,6 +10,8 @@ class Prestudent_model extends DB_Model
parent::__construct();
$this->dbTable = 'public.tbl_prestudent';
$this->pk = 'prestudent_id';
$this->load->model('crm/prestudentstatus_model', 'PrestudentstatusModel');
}
/**
@@ -208,7 +210,6 @@ class Prestudent_model extends DB_Model
return error('prestudent could not be loaded');
//Prestudentstatus
$this->load->model('crm/prestudentstatus_model', 'PrestudentstatusModel');
$lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id);
if ($lastStatus->error)
@@ -310,8 +311,6 @@ class Prestudent_model extends DB_Model
if (!hasData($prestudents))
return $bewerbungen;
$this->load->model('crm/prestudentstatus_model', 'PrestudentstatusModel');
foreach ($prestudents->retval as $prestudent)
{
$lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent->prestudent_id, $studiensemester_kurzbz);
@@ -424,7 +423,6 @@ class Prestudent_model extends DB_Model
if (!hasData($prestudent))
return false;
$this->load->model('prestudentstatus_model', 'PrestudentstatusModel');
$lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id, null, 'Interessent');
if (!hasData($lastStatus))