The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ

Fixed relationship between user and userdata.

master
Polonkai Gergely 11 years ago
parent 56de160dc1
commit 45b4e11fef
  1. 2
      src/KekRozsak/FrontBundle/Controller/DefaultController.php
  2. 3
      src/KekRozsak/FrontBundle/Entity/UserData.php
  3. 7
      src/KekRozsak/SecurityBundle/Entity/User.php

@ -61,7 +61,7 @@ class DefaultController extends Controller
$form->bindRequest($request);
if ($form->isValid())
{
if ($this->getPassword() == '')
if ($user->getPassword() == '')
$user->setPassword($oldPassword);
else
$user->setPassword($this->get('security.encoder_factory')->getEncoder($user)->encodePassword($user->getPassword(), $user->getSalt()));

@ -26,7 +26,8 @@ class UserData
/**
* @var KekRozsak\SecurityBundle\Entity\User $user
* @ORM\Id
* @ORM\OneToOne(targetEntity="KekRozsak\SecurityBundle\Entity\User")
* @ORM\GeneratedValue(strategy="NONE")
* @ORM\OneToOne(targetEntity="KekRozsak\SecurityBundle\Entity\User", inversedBy="userData")
* @ORM\JoinColumn(name="user_id")
*/
protected $user;

@ -247,8 +247,7 @@ class User implements UserInterface, AdvancedUserInterface
/**
* @var \KekRozsak\FrontBundle\Entity\UserData $userData
* @ORM\OneToMany(targetEntity="KekRozsak\FrontBundle\Entity\UserData", fetch="LAZY", cascade={"persist"}, mappedBy="user")
* @ORM\JoinColumn(name="id", referencedColumnName="user_id")
* @ORM\OneToOne(targetEntity="KekRozsak\FrontBundle\Entity\UserData", fetch="LAZY", cascade={"persist"}, mappedBy="user")
*/
protected $userData;
@ -261,7 +260,7 @@ class User implements UserInterface, AdvancedUserInterface
*/
public function setUserData(\KekRozsak\FrontBundle\Entity\UserData $userData = null)
{
$this->userData = new ArrayCollection(array($userData));
$this->userData = $userData;
$userData->setUser($this);
return $this;
}
@ -273,7 +272,7 @@ class User implements UserInterface, AdvancedUserInterface
*/
public function getUserData()
{
return $this->userData->get(1);
return $this->userData;
}
/**

Loading…
Cancel
Save