public function updateProperty($propertyId, $userId, $value) { $user = $this->userRepo->find($userId); $property = $this->userPropRepo->findOneBy(array('user' => $user, 'id' => $propertyId)); $property->setValue($value); $this->em->persist($property); $this->em->flush(); }
public function activateUser($userId, $secretCode) { $user = $this->userRepo->find($userId); if ($user != null && $user->getSecretKey() === $secretCode) { $user->setIsActive(true); $user->setSecretKey(""); $this->em->persist($user); $this->em->flush(); return true; } return false; }