function setDepartment($id) { $id = trim($id); $dlf = new DepartmentListFactory(); if ($id != 0 or $this->Validator->isResultSetWithRows('company', $dlf->getByID($id), TTi18n::gettext('Company is invalid'))) { $this->data['department_id'] = $id; return TRUE; } return FALSE; }
function setDefaultDepartment($id) { $id = trim($id); Debug::Text('Department ID: ' . $id, __FILE__, __LINE__, __METHOD__, 10); $dlf = new DepartmentListFactory(); if ($id == 0 or $this->Validator->isResultSetWithRows('default_department', $dlf->getByID($id), TTi18n::gettext('Invalid Default Department'))) { $this->data['default_department_id'] = $id; return TRUE; } return FALSE; }
function setDepartment($id) { $id = trim($id); if ($id == FALSE or $id == 0 or $id == '') { $id = 0; } $dlf = new DepartmentListFactory(); if ($id == 0 or $this->Validator->isResultSetWithRows('department', $dlf->getByID($id), TTi18n::gettext('Department does not exist'))) { $this->data['department_id'] = $id; return TRUE; } return FALSE; }