| Server IP : 162.214.74.102 / Your IP : 216.73.217.80 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/public_html/lrsys_apps/regional/application/plugins/module_pcp/models/ |
Upload File : |
<?php
/**
*
*/
class Backlog extends Model
{
public $_user;
public $_maintenance;
public $_equipament;
/**
* To override the default naming behaviour and directly specify a table name
*
* @var string
*/
public static $_table = 'module_pcp_equipaments_maintenance_backlogs';
public function __construct()
{
$this->_maintenance = ORM::for_table('module_pcp_equipament_maintenance');
$this->_equipament = ORM::for_table('module_pcp_equipaments');
}
public function save()
{
parent::save();
if(!Maintenance::has_backlogs($this->id_maintenance)) {
$maintenance = $this->maintenance()->find_one();
$maintenance->status = '2';
$maintenance->save();
} else {
$maintenance = $this->maintenance()->find_one();
if($maintenance->status == '0') {
return true;
}
$maintenance->status = '0';
$maintenance->save();
}
return true;
}
public function maintenance()
{
return $this->belongs_to('Maintenance','id_maintenance','id');
}
public function getMaintenance()
{
$user = ORM::for_table('module_pcp_equipament_maintenance')->findOne($this->id_maintenance);
return $user;
}
}