/** * Get the associated Partido object * * @param PropelPDO Optional Connection object. * @return Partido The associated Partido object. * @throws PropelException */ public function getPartido(PropelPDO $con = null) { if ($this->aPartido === null && $this->partido_id !== null) { $this->aPartido = PartidoPeer::retrieveByPk($this->partido_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->aPartido->addEtiquetaPartidos($this); */ } return $this->aPartido; }
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); } } } } } }