public function executeGtalkupdate($request) { $connection = RaykuCommon::getDatabaseConnection(); /* @var $user User */ $user = $this->getUser()->getRaykuUser(); $userGtalk = $user->getUserGtalk(); if (!$userGtalk) { $userGtalk = new UserGtalk(); $userGtalk->setUser($user); } $email = $request->getParameter('gtalkname'); $checkemail = explode("@", $email); if (count($checkemail) == 1) { $email .= '@gmail.com'; } $test = BotServiceProvider::createFor(sfConfig::get('app_rayku_url') . ':' . sfConfig::get('app_g_chat_port') . '/add/' . $email)->getContent(); if ($test) { $_SESSION['adduser'] = 1; } else { $_SESSION['adduser'] = 2; $this->redirect('/dashboard/gtalk'); } $userGtalk->setGtalkid($email); $userGtalk->save(); $this->redirect('/dashboard/gtalk'); }
/** * Sets a single UserGtalk object as related to this object by a one-to-one relationship. * * @param UserGtalk $l UserGtalk * @return User The current object (for fluent API support) * @throws PropelException */ public function setUserGtalk(UserGtalk $v) { $this->singleUserGtalk = $v; // Make sure that that the passed-in UserGtalk isn't already associated with this object if ($v->getUser() === null) { $v->setUser($this); } return $this; }