public function updateSession(\Lexicon\Port\Adaptor\Data\Lexicon\Session $session) { $locator = \Lexicon\Infrastructure\Helpers\Locator::getInstance(); $conn = $locator->locate("DB_CONNECT"); $handler = $locator->locate("VALIDATION_HANDLER"); $session->validateType($handler); if ($handler->hasErrors()) { throw new \Exception($handler, $code); } else { $qb = $locator->locate("DB_QUERY_BUILDER", []); $query = $qb->update()->t("t_sessions")->set()->c("used")->eq()->val($session->getUsed(), $qb::NOT_NULL)->c("attempts")->eq()->val($session->getAttempts(), $qb::NOT_NULL)->c("xmlview")->eq()->val($session->toXmlStr())->where()->c("user_id")->eq()->val($session->getUserId())->andTrue()->c("code")->eq()->val($session->getCode())->fi(); //print($query);print_r($params);exit; $sth = $conn->prepare($query); $sth->execute($qb->getParams()); return $this->findSession($session->getUserId(), $session->getCode()); } }