/** * Get the associated Politico object * * @param PropelPDO Optional Connection object. * @return Politico The associated Politico object. * @throws PropelException */ public function getPolitico(PropelPDO $con = null) { if ($this->aPolitico === null && $this->politico_id !== null) { $this->aPolitico = PoliticoPeer::retrieveByPk($this->politico_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->aPolitico->addPoliticoInstitucions($this); */ } return $this->aPolitico; }
private function updateSums(sfWebRequest $request) { // Actualizar cache y puntos en politicos if ($request->getParameter("t") == Politico::NUM_ENTITY) { $this->politico = PoliticoPeer::retrieveByPk($request->getParameter('e')); $this->politico->setSumu($this->politico->getPositives()); $this->politico->setSumd($this->politico->getNegatives()); if ($this->politico->isModified()) { PoliticoPeer::doUpdate($this->politico); } $this->clearCache($this->politico); } else { if ($request->getParameter("t") == Partido::NUM_ENTITY) { $this->partido = PartidoPeer::retrieveByPk($request->getParameter('e')); $this->partido->setSumu($this->partido->getPositives()); $this->partido->setSumd($this->partido->getNegatives()); if ($this->partido->isModified()) { PartidoPeer::doUpdate($this->partido); } $this->clearCachePartido($this->partido); } else { if ($request->getParameter("t") == '') { $review = SfReviewPeer::retrieveByPk($request->getParameter('e')); if ($review->getSfReviewType()->getId() == Politico::NUM_ENTITY) { $politico = PoliticoPeer::retrieveByPk($review->getEntityId()); $this->clearCache($politico); } else { if ($review->getSfReviewType()->getId() == Partido::NUM_ENTITY) { $partido = PartidoPeer::retrieveByPk($review->getEntityId()); $this->clearCachePartido($partido); } } } } } }