Commit ddb0b331 authored by hlarget's avatar hlarget 👹
Browse files

Merge branch '4-move-subscriptionpermission-to-this-bundle' into 'master'

Resolve "Move SubscriptionPermission to this bundle"

Closes #4

See merge request !5
parents 885c6b66 de83f4b8
<?php
/**
* Created by PhpStorm.
* User: henri
* Date: 18/10/18
* Time: 10:47
*/
namespace Aboutgoods\KonnectBundle\Model;
class SubscriptionPermission
{
/**
* @var string
*/
private $company;
/**
* @var array
*/
private $permissions = [];
/**
* @var array
*/
private $settings = [];
/**
* @return string
*/
public function getCompany(): string
{
return $this->company;
}
/**
* @param string $company
*/
public function setCompany(string $company)
{
$this->company = $company;
return $this;
}
/**
* @return array
*/
public function getPermissions(): array
{
return $this->permissions;
}
/**
* @param array $permissions
*/
public function setPermissions(array $permissions)
{
$this->permissions = $permissions;
return $this;
}
/**
* @return array
*/
public function getSettings(): array
{
return $this->settings;
}
/**
* @param array $settings
*/
public function setSettings(array $settings)
{
$this->settings = $settings;
return $this;
}
}
\ No newline at end of file
<?php
namespace Aboutgoods\KonnectBundle\Model;
use net\aboutgoods\konnect\model\response\SubscriptionPermission;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Serializer\Serializer;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
/**
* Created by PhpStorm.
......@@ -380,7 +381,7 @@ class User implements UserInterface
{
$this->subscriptions = [];
foreach ($subscriptions as $subscription) {
$this->subscriptions[] = SubscriptionPermission::loadFromArray($subscription);
$this->subscriptions[] = $subscription;
}
return $this;
......
......@@ -6,7 +6,7 @@ use Aboutgoods\KonnectBundle\Model\User;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface;
use net\aboutgoods\konnect\model\response\SubscriptionPermission;
use Aboutgoods\KonnectBundle\Model\SubscriptionPermission;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
use HWI\Bundle\OAuthBundle\Security\Core\User\OAuthAwareUserProviderInterface;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment