function getByDepartmentBranchId($id, $where = NULL, $order = NULL) { if ($id == '') { return FALSE; } $dbf = new DepartmentBranchFactory(); $ph = array('id' => $id); $query = ' select a.* from ' . $this->getTable() . ' as a, ' . $dbf->getTable() . ' as b where b.id = a.department_branch_id AND department_branch_id = ? '; $query .= $this->getWhereSQL($where); $query .= $this->getSortSQL($order); $this->rs = $this->db->Execute($query, $ph); return $this; }