Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- public function getPrice($tracks = FALSE) {
- $price = 0;
- if(!$tracks) {
- $tracks = Doctrine_Query::create()->from('Song s')->where('s._album = ?', $this['_id'])->execute();
- }
- foreach($tracks as $track) {
- $price += $track->get_price();
- }
- return sprintf('%.2f', $price);
- }
Add Comment
Please, Sign In to add comment