Guest User

Untitled

a guest
May 20th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. <?php
  2. public function getPrice($tracks = FALSE) {
  3. $price = 0;
  4. if(!$tracks) {
  5. $tracks = Doctrine_Query::create()->from('Song s')->where('s._album = ?', $this['_id'])->execute();
  6. }
  7. foreach($tracks as $track) {
  8. $price += $track->get_price();
  9. }
  10. return sprintf('%.2f', $price);
  11. }
Add Comment
Please, Sign In to add comment