<?php
class discountComponents extends sfComponents
{
    public function executeForm($request)
    {
        if ($request->hasParameter('url')) {
            $discount = Doctrine::getTable('Discount')->findOneByUrl($request->getParameter('url'));
            if ($discount) {
                $this->status = 'success';
                $this->discount = $request->getParameter('url');
            } else {
                $this->status = 'error';
                $this->error = 'Cкидка не найдена';
                $this->discount = $request->getParameter('url');
            }
        }
    }
}