UserModel example


    }

    /** * @return UserModel */
    public function create(array $params)
    {
        $this->checkPrivilege('create', 'usermanager');

        // Create models         $user = new UserModel();
        $params = $this->prepareAssociatedData($params$user);
        $user->fromArray($params);

        /** @var UserValidator $userValidator */
        $userValidator = $this->getContainer()->get('shopware.auth.validator.user_validator');
        $userValidator->validate($user);

        $this->getManager()->persist($user);
        $this->flush();

        return $user;
    }
Home | Imprint | This part of the site doesn't use cookies.