0
I have two methods a loadById and loadByCpf, I would like to create a single method, ex: loadClient, as I do?
public function loadByCpf($cpfcust)
{
$sql = new Sql();
$results = $sql->select("SELECT * FROM tb_custumer WHERE cpfcust = :cpfcust", array(
":cpfcust"=>$cpfcust
));
}
public function loadById($idcust)
{
$sql = new Sql();
$results = $sql->select("SELECT * FROM tb_custumer WHERE idcust = :idcust", array(
":idcust"=>$idcust
));
}
What have you tried? What problem have you had?
– Costamilam