public function addAction()
{
//validate the POST variables
$emailNotifier = new EmailNotifier('
[email protected]',
new Mailer,
new MailFactory
);
$emailNotifier->setCcAddress('
[email protected]');
$emailNotifier->setCcAddress('
[email protected]');
$mapper = new DataMapper();
$productSaver = new ProductSaver($emailNotifier, $mapper);
$productSaver->setNotifier($emailNotifier);
$productSaver->save($product);
}
$emailNotifier = new EmailNotifier('
[email protected]',
new Mailer,
new MailFactory
);
$emailNotifier->addCcAddress('
[email protected]');
$emailNotifier->addCcAddress('
[email protected]');
$mapper = new DataMapper();
$productSaver = new ProductSaver($mapper);
$productSaver->addNotifier($emailNotifier);