<?php

/**
 * poll actions.
 *
 * @package    tvtl
 * @subpackage poll
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 2288 2006-10-02 15:22:13Z fabien $
 */
class pollActions extends autopollActions
{
  public function executeDel()
  {
    /*$id_list = $this->getRequestParameter('idList');
    $page = $this->getRequestParameter('page');
    $id_array = explode(",", $id_list);*/

    $this->tblpoll = TblpollPeer::retrieveByPk($this->getRequestParameter('idList'));
    $this->forward404Unless($this->tblpoll);

    try
    {
      $this->deleteTblpoll($this->tblpoll);
    }
    catch (PropelException $e)
    {
      $this->getRequest()->setError('delete', 'Could not delete the selected Tblpoll. Make sure it does not have any associated items.');
      return $this->forward('poll', 'list');
    }

    return $this->redirect('poll/list');
  }

  protected function deleteTblpoll($tblpoll)
  {
    $tblpoll->delete();
  }
}
