public static function setDepartment($IDDepartment = NULL) { $IDDepartment = self::NumberValidate($IDDepartment, EXC_INVALID_IDDEPARTMENT); if (!empty($IDDepartment)) { $StWhere = " TD.IDDepartment = {$IDDepartment} "; } else { if (empty(self::$IDSupporterLogged)) { throw new errorHandler(EXC_BAD_ARGUMENT . ' "IDSupporterLogged" '); } // die('aqui >> '. self::$IDSupporterLogged); $ArDepartment = F1DeskUtils::getDepartments(self::$IDSupporterLogged); $ArDepartment = array_keys($ArDepartment); // print_R($ArDepartment); foreach ((array) $ArDepartment as $StDepartment) { if (is_numeric($StDepartment)) { $ArIDDepartment[] = $StDepartment; } } unset($ArDepartment); $StInDepartment = implode(',', $ArIDDepartment); $StWhere = " TD.IDDepartment IN ( {$StInDepartment} ) "; } self::$BoSetDepartment = TRUE; self::ArWhereAdd($StWhere); }