Esempio n. 1
0
 public function executeDelete(sfWebRequest $request)
 {
     $request->checkCSRFProtection();
     $this->forward404Unless($Hero = HeroPeer::retrieveByPk($request->getParameter('id')), sprintf('Object Hero does not exist (%s).', $request->getParameter('id')));
     $Hero->delete();
     $this->redirect('hero/index');
 }
Esempio n. 2
0
 /**
  * Get the associated Hero object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     Hero The associated Hero object.
  * @throws     PropelException
  */
 public function getHero(PropelPDO $con = null)
 {
     if ($this->aHero === null && $this->hero_id !== null) {
         $this->aHero = HeroPeer::retrieveByPk($this->hero_id);
         /* The following can be used additionally to
         		   guarantee the related object contains a reference
         		   to this object.  This level of coupling may, however, be
         		   undesirable since it could result in an only partially populated collection
         		   in the referenced object.
         		   $this->aHero->addHeroSkills($this);
         		 */
     }
     return $this->aHero;
 }