0
In the example:
public function getEstoqueDeposito($busca, $deposito = FALSE) {
...
}
I know what I could do:
public function getEstoqueDeposito($busca, $deposito = FALSE) {
if($busca == 'TOTAL'){
...
return "whatever";
} else if($busca == 'GRUPO'){
...
return "whatever";
}
return "Parâmetro inválido";
}
Anyway, I would like to preset the values (TOTAL or GROUP) in the $search parameter, in PHP, have some way to do this without the need to do a test within the function?
I don’t think I understand, you’ve done it in $deposit, just do the same in search $search = 'TOTAL'
– Anderson Henrique
Hello Anderson, it is not preset if the parameter is not passed, in fact I need the function to only accept TOTAL or GROUP in the $search parameter.
– Rafael Weber
http://php.net/manual/en/class.splenum.php
– Valdeir Psr