public function getFamily() { $c = new Criteria(); $c->add(FamilyPeer::USER_ID, $this->getId()); return FamilyPeer::doSelectOne($c); }
public function executeLoraccept() { $lor = LorvaluesPeer::retrieveByPK($this->getRequestParameter('lorid')); $c = new Criteria(); $c->add(FamilyPeer::USER_ID, $this->getUser()->getAttribute('userid')); $family = FamilyPeer::doSelectOne($c); //$family->setLinkedin($lor->getData()); $family->save(); $c = new Criteria(); $c->add(LoruserPeer::USER_ID, $this->getUser()->getAttribute('userid')); $c->addJoin(LoruserPeer::LORVALUES_ID, LorvaluesPeer::ID); $c->add(LorvaluesPeer::LORFIELDS_ID, sfConfig::get('app_lor_linkedin')); $lors = LorvaluesPeer::doSelect($c); foreach ($lors as $lor) { $c = new Criteria(); $c->add(LoruserPeer::LORVALUES_ID, $lor->getId()); $loruser = LoruserPeer::doSelectOne($c); $loruser->delete(); $lor->delete(); } $this->redirect('/family/show'); }