add events + more wip classes
This commit is contained in:
30
lib/User/Event/FormEvent.php
Normal file
30
lib/User/Event/FormEvent.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace Da\User\Event;
|
||||
|
||||
use yii\base\Event;
|
||||
use yii\base\Model;
|
||||
|
||||
/**
|
||||
*
|
||||
* FormEvent.php
|
||||
*
|
||||
* Date: 4/12/16
|
||||
* Time: 15:11
|
||||
* @author Antonio Ramirez <hola@2amigos.us>
|
||||
*/
|
||||
class FormEvent extends Event
|
||||
{
|
||||
protected $form;
|
||||
|
||||
public function __construct(Model $form, array $config = [])
|
||||
{
|
||||
$this->form = $form;
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
public function getForm()
|
||||
{
|
||||
return $this->form;
|
||||
}
|
||||
}
|
||||
|
||||
24
lib/User/Event/ProfileEvent.php
Normal file
24
lib/User/Event/ProfileEvent.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
namespace Da\User\Event;
|
||||
|
||||
use Da\User\Model\Profile;
|
||||
use yii\base\Event;
|
||||
|
||||
|
||||
class ProfileEvent extends Event
|
||||
{
|
||||
protected $profile;
|
||||
|
||||
public function __construct(Profile $profile, array $config = [])
|
||||
{
|
||||
|
||||
$this->profile = $profile;
|
||||
|
||||
return parent::__construct($config);
|
||||
}
|
||||
|
||||
public function getProfile()
|
||||
{
|
||||
return $this->profile;
|
||||
}
|
||||
}
|
||||
31
lib/User/Event/ResetPasswordEvent.php
Normal file
31
lib/User/Event/ResetPasswordEvent.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace Da\User\Event;
|
||||
|
||||
|
||||
use Da\User\Form\RecoveryForm;
|
||||
use Da\User\Model\Token;
|
||||
use yii\base\Event;
|
||||
|
||||
class ResetPasswordEvent extends Event
|
||||
{
|
||||
protected $form;
|
||||
protected $token;
|
||||
|
||||
public function __construct(RecoveryForm $form, Token $token, array $config = [])
|
||||
{
|
||||
$this->form = $form;
|
||||
$this->token = $token;
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
public function getForm()
|
||||
{
|
||||
return $this->form;
|
||||
}
|
||||
|
||||
public function getToken()
|
||||
{
|
||||
return $this->token;
|
||||
}
|
||||
}
|
||||
31
lib/User/Event/SocialNetworkAuthEvent.php
Normal file
31
lib/User/Event/SocialNetworkAuthEvent.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace Da\User\Event;
|
||||
|
||||
use Da\User\Model\SocialNetworkAccount;
|
||||
use yii\authclient\ClientInterface;
|
||||
use yii\base\Event;
|
||||
|
||||
|
||||
class SocialNetworkAuthEvent extends Event
|
||||
{
|
||||
protected $client;
|
||||
protected $account;
|
||||
|
||||
public function __construct(SocialNetworkAccount $account, ClientInterface $client, $config = [])
|
||||
{
|
||||
$this->account = $account;
|
||||
$this->client = $client;
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
public function getClient()
|
||||
{
|
||||
return $this->client;
|
||||
}
|
||||
|
||||
public function getAccount()
|
||||
{
|
||||
return $this->account;
|
||||
}
|
||||
}
|
||||
31
lib/User/Event/SocialNetworkConnectEvent.php
Normal file
31
lib/User/Event/SocialNetworkConnectEvent.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace Da\User\Event;
|
||||
|
||||
use Da\User\Model\SocialNetworkAccount;
|
||||
use Da\User\Model\User;
|
||||
use yii\base\Event;
|
||||
|
||||
|
||||
class SocialNetworkConnectEvent extends Event
|
||||
{
|
||||
protected $user;
|
||||
protected $account;
|
||||
|
||||
public function __construct(User $user, SocialNetworkAccount $account, $config = [])
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->account = $account;
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
public function getUser()
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function getAccount()
|
||||
{
|
||||
return $this->account;
|
||||
}
|
||||
}
|
||||
24
lib/User/Event/UserEvent.php
Normal file
24
lib/User/Event/UserEvent.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
namespace Da\User\Event;
|
||||
|
||||
use Da\User\Model\User;
|
||||
use yii\base\Event;
|
||||
|
||||
class UserEvent extends Event
|
||||
{
|
||||
const EVENT_BEFORE_CREATE = 'beforeCreate';
|
||||
const EVENT_AFTER_CREATE = 'afterCreate';
|
||||
|
||||
protected $user;
|
||||
|
||||
public function __construct(User $user, array $config = [])
|
||||
{
|
||||
$this->user = $user;
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
public function getUser()
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user