function setBranch($id) { $id = trim($id); $blf = new BranchListFactory(); if ($this->Validator->isResultSetWithRows('branch', $blf->getByID($id), TTi18n::gettext('Selected Branch is invalid'))) { $this->data['branch_id'] = $id; return TRUE; } return FALSE; }
function setDefaultBranch($id) { $id = trim($id); Debug::Text('Branch ID: ' . $id, __FILE__, __LINE__, __METHOD__, 10); $blf = new BranchListFactory(); if ($id == 0 or $this->Validator->isResultSetWithRows('default_branch', $blf->getByID($id), TTi18n::gettext('Invalid Default Branch'))) { $this->data['default_branch_id'] = $id; return TRUE; } return FALSE; }
function setBranch($id) { $id = trim($id); if ($id == FALSE or $id == 0 or $id == '') { $id = 0; } $blf = new BranchListFactory(); if ($id == 0 or $this->Validator->isResultSetWithRows('branch', $blf->getByID($id), TTi18n::gettext('Branch does not exist'))) { $this->data['branch_id'] = $id; return TRUE; } return FALSE; }