Add custom fields to user model.

This commit is contained in:
James Cole 2021-05-09 07:47:58 +02:00
parent 15fde3a220
commit 47ef9a0102
No known key found for this signature in database
GPG Key ID: B5669F9493CDE38D

View File

@ -140,6 +140,14 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* @property-read int|null $object_groups_count
* @property-read \Illuminate\Database\Eloquent\Collection|Webhook[] $webhooks
* @property-read int|null $webhooks_count
* @property string|null $two_factor_secret
* @property string|null $two_factor_recovery_codes
* @property string|null $guid
* @property string|null $domain
* @method static Builder|User whereDomain($value)
* @method static Builder|User whereGuid($value)
* @method static Builder|User whereTwoFactorRecoveryCodes($value)
* @method static Builder|User whereTwoFactorSecret($value)
*/
class User extends Authenticatable
{
@ -439,4 +447,70 @@ class User extends Authenticatable
{
return $this->hasManyThrough(Transaction::class, TransactionJournal::class);
}
// start LDAP related code
/**
* Get the database column name of the domain.
*
* @return string
*/
public function getLdapDomainColumn()
{
return 'domain';
}
/**
* Get the models LDAP domain.
*
* @return string
*/
public function getLdapDomain()
{
return $this->{$this->getLdapDomainColumn()};
}
/**
* Set the models LDAP domain.
*
* @param string $domain
*
* @return void
*/
public function setLdapDomain($domain)
{
$this->{$this->getLdapDomainColumn()} = $domain;
}
/**
* Get the models LDAP GUID database column name.
*
* @return string
*/
public function getLdapGuidColumn()
{
return 'objectguid';
}
/**
* Get the models LDAP GUID.
*
* @return string
*/
public function getLdapGuid()
{
return $this->{$this->getLdapGuidColumn()};
}
/**
* Set the models LDAP GUID.
*
* @param string $guid
*
* @return void
*/
public function setLdapGuid($guid)
{
$this->{$this->getLdapGuidColumn()} = $guid;
}
// end LDAP related code
}