ApiPlatform\Core\Tests\Fixtures\TestBundle\Manager\UserManager::updateUser PHP Method

updateUser() public method

public updateUser ( FOS\UserBundle\Model\UserInterface $user, $andFlush = true )
$user FOS\UserBundle\Model\UserInterface
    public function updateUser(UserInterface $user, $andFlush = true)
    {
        // Extract email part before the `@` character to use it as username is username not set
        if (null === $user->getUsername()) {
            $user->setUsername(substr($user->getEmail(), 0, strpos($user->getEmail(), '@')));
        }
        // Call parent after as does not override parent and parent do the flush
        parent::updateUser($user, $andFlush);
    }
UserManager