convertir __toString() en entier
Salut a tous je cherche a savoir si il y avais pas un moyen pour convertir la valeur d'un entier __toString() en entier réelle .
j’explique j'ai une class TVA avec :
Code:
1 2 3 4 5 6 7
| class Tva extends BaseTva
{
public function __toString() {
return $this->getIndices() ;
}
} |
et je cherche a ajouter la TVA, a un prix, d'un produit sans passer pas par un "lefjoint".
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| class Produit extends BaseProduit {
protected function getTotalpro() {
$tva = $this->getTva();
$prix = $this->getTarif();
return $prix * $tva / 100;
}
public function getPrixTTC()
{
return $this->getTarif() * $this->getTotalpro() ;
}
} |
sa me marque en mode dev:
Code:
1 2 3 4
| +
-
Notice: Object of class Tva could not be converted to int in /Applications/MAMP/htdocs/test5/lib/model/doctrine/Produit.class.php on line 18 |
si quelqu'un sais merci de m'aider