Mvc\Model::sum

public static mixed sum ([array $parameters])

Allows to calculate a sum on a column that match the specified conditions

1
2
3
4
5
6
7
//How much are all robots?
 $sum = Robots::sum(array('column' => 'price'));
 echo "The total price of robots is ", $sum, "\n";
 
 //How much are mechanical robots?
 $sum = Robots::sum(array("type = 'mechanical'", 'column' => 'price'));
 echo "The total price of mechanical robots is  ", $sum, "\n";
doc_Phalcon
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.