/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param UserGtalk $value A UserGtalk object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(UserGtalk $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getUserid(); } // if key === null self::$instances[$key] = $obj; } }
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; }