added registration process

This commit is contained in:
Antonio Ramirez
2016-12-09 09:36:18 +01:00
parent c3aad1b47d
commit 6457fbe2c2
17 changed files with 208 additions and 123 deletions

View File

@ -138,7 +138,7 @@ class Profile extends ActiveRecord
*/
public function getUser()
{
return $this->hasOne($this->getClassMap()->get('User'), ['id' => 'user_id']);
return $this->hasOne($this->getClassMap()->get(User::class), ['id' => 'user_id']);
}
/**

View File

@ -96,7 +96,7 @@ class SocialNetworkAccount extends ActiveRecord
*/
public function getUser()
{
return $this->hasOne($this->getClassMap()->get('User'), ['id' => 'user_id']);
return $this->hasOne($this->getClassMap()->get(User::class), ['id' => 'user_id']);
}
/**

View File

@ -74,7 +74,7 @@ class Token extends ActiveRecord
*/
public function getUser()
{
return $this->hasOne($this->getClassMap()->get('User'), ['id' => 'user_id']);
return $this->hasOne($this->getClassMap()->get(User::class), ['id' => 'user_id']);
}
/**

View File

@ -236,7 +236,7 @@ class User extends ActiveRecord implements IdentityInterface
*/
public function getProfile()
{
return $this->hasOne($this->getClassMap()->get('Profile'), ['user_id' => 'id']);
return $this->hasOne($this->getClassMap()->get(Profile::class), ['user_id' => 'id']);
}
/**
@ -246,7 +246,9 @@ class User extends ActiveRecord implements IdentityInterface
{
if ($this->connectedAccounts == null) {
/** @var SocialNetworkAccount[] $accounts */
$accounts = $this->hasMany($this->getClassMap()->get('Account'), ['user_id' => 'id'])->all();
$accounts = $this->hasMany($this->getClassMap()
->get(SocialNetworkAccount::class), ['user_id' => 'id'])
->all();
foreach ($accounts as $account) {
$this->connectedAccounts[$account->provider] = $account;