getConfiguration()->loadHelpers('Partial', 'Common'); $to = array(); $users = Doctrine::getTable('sfGuardGroup')->findOneById(3)->getUsers(); //Skupina prijemnu emailu foreach($users as $user) { $to[] = $user->getEmailAddress(); } if(strlen($this->getRepresentantEmail())) { $to[] = $this->getRepresentantEmail(); } if(strlen($this->getUserEmail())) { $to[] = $this->getUserEmail(); } return sfContext::getInstance()->getMailer()->composeAndSend( 'no-reply@pharmalink.cz', $to, 'Nová objednávka - JOS', get_partial('basket/confirmMailBody', array('invoice' => $this))); } public function getProductsPrice() { $price = 0; foreach($this->getItems() as $item) { $price += $item->getPriceAll(); } return $price; } }