Permalink
Browse files

Fixing namechange

  • Loading branch information...
SahAssar committed Jun 14, 2017
1 parent 03c4ce8 commit 0e3e699455702a47de6430739dfa5a4e87a99460
Showing with 20 additions and 20 deletions.
  1. +13 −13 src/MemberFieldsExtension.php
  2. +7 −7 src/ProfileEditType.php
@@ -1,32 +1,32 @@
<?php
namespace sahassar\MemberFields;
namespace BoltAuth\AuthFields;
use Bolt\Extension\SimpleExtension;
use Bolt\Extension\Bolt\Members\Event\FormBuilderEvent;
use Bolt\Extension\Bolt\Members\Event\MembersProfileEvent;
use Bolt\Extension\Bolt\Members\Form\MembersForms;
use Bolt\Extension\Bolt\Members\Event\MembersEvents;
use Bolt\Extension\BoltAuth\Auth\Event\FormBuilderEvent;
use Bolt\Extension\BoltAuth\Auth\Event\AuthProfileEvent;
use Bolt\Extension\BoltAuth\Auth\Form\AuthForms;
use Bolt\Extension\BoltAuth\Auth\Event\AuthEvents;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class MemberFieldsExtension extends SimpleExtension
class AuthFieldsExtension extends SimpleExtension
{
/**
* {@inheritdoc}
*/
protected function subscribe(EventDispatcherInterface $dispatcher)
{
$dispatcher->addListener(MembersEvents::MEMBER_PROFILE_PRE_SAVE, [$this, 'onProfileSave']);
$dispatcher->addListener(MembersEvents::MEMBER_PROFILE_REGISTER, [$this, 'onProfileSave']);
$dispatcher->addListener(AuthEvents::AUTH_PROFILE_PRE_SAVE, [$this, 'onProfileSave']);
$dispatcher->addListener(AuthEvents::AUTH_PROFILE_REGISTER, [$this, 'onProfileSave']);
$dispatcher->addListener(FormBuilderEvent::BUILD, [$this, 'onRequest']);
}
/**
* Tell Members what fields we want to persist.
* Tell Auth what fields we want to persist.
*
* @param MembersProfileEvent $event
* @param AuthProfileEvent $event
*/
public function onProfileSave(MembersProfileEvent $event)
public function onProfileSave(AuthProfileEvent $event)
{
// Meta fields that we want to register
$fields = [];
@@ -43,12 +43,12 @@ public function onProfileSave(MembersProfileEvent $event)
*/
public function onRequest(FormBuilderEvent $event)
{
if ($event->getName() !== MembersForms::PROFILE_EDIT && $event->getName() !== MembersForms::PROFILE_VIEW && $event->getName() !== MembersForms::PROFILE_REGISTER) {
if ($event->getName() !== AuthForms::PROFILE_EDIT && $event->getName() !== AuthForms::PROFILE_VIEW && $event->getName() !== AuthForms::PROFILE_REGISTER) {
return;
}
$app = $this->getContainer();
$type = new ProfileEditType($app['members.config'], $this->getConfig());
$type = new ProfileEditType($app['auths.config'], $this->getConfig());
$entityClassName = Profile::class;
@@ -1,24 +1,24 @@
<?php
namespace sahassar\MemberFields;
namespace BoltAuth\AuthFields;
use Bolt\Extension\Bolt\Members\Form\Type\ProfileEditType as MembersProfileEditType;
use Bolt\Extension\BoltAuth\Auth\Form\Type\ProfileEditType as AuthProfileEditType;
use Symfony\Component\Form\CallbackTransformer;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints as Assert;
use Bolt\Extension\Bolt\Members\Config\Config as MembersConfig;
use Bolt\Extension\BoltAuth\Auth\Config\Config as AuthConfig;
class ProfileEditType extends MembersProfileEditType
class ProfileEditType extends AuthProfileEditType
{
/**
* Constructor.
*
* @param MembersConfig $membersConfig
* @param AuthConfig $authsConfig
* @param array $fieldConfigs
*/
public function __construct(MembersConfig $membersConfig, $fieldConfigs)
public function __construct(AuthConfig $authsConfig, $fieldConfigs)
{
parent::__construct($membersConfig);
parent::__construct($authsConfig);
$this->fieldConfigs = $fieldConfigs;
}

0 comments on commit 0e3e699

Please sign in to comment.