parent
5d31633eb5
commit
263f09a94c
|
@ -96,6 +96,13 @@ class DbUserBackend implements UserBackend
|
|||
*/
|
||||
private $userColumnName = 'username';
|
||||
|
||||
/**
|
||||
* Column name of email
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $emailColumnName = null;
|
||||
|
||||
/**
|
||||
* Name of the backend
|
||||
*
|
||||
|
@ -182,6 +189,18 @@ class DbUserBackend implements UserBackend
|
|||
$this->activeColumnName = $activeColumnName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for email column
|
||||
*
|
||||
* Set to null if not needed
|
||||
*
|
||||
* @param string $emailColumnName
|
||||
*/
|
||||
public function setEmailColumnName($emailColumnName)
|
||||
{
|
||||
$this->emailColumnName = $emailColumnName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the backend
|
||||
*
|
||||
|
@ -312,10 +331,13 @@ class DbUserBackend implements UserBackend
|
|||
*
|
||||
* @return User The created instance of User.
|
||||
*/
|
||||
private function createUserFromResult(stdClass $resultRow)
|
||||
protected function createUserFromResult(stdClass $resultRow)
|
||||
{
|
||||
$usr = new User(
|
||||
$resultRow->{$this->userColumnName}
|
||||
$resultRow->{$this->userColumnName},
|
||||
null,
|
||||
null,
|
||||
(isset($resultRow->{$this->emailColumnName})) ? $resultRow->{$this->emailColumnName} : null
|
||||
);
|
||||
return $usr;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue