32 lines
757 B
PHP
32 lines
757 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
|
|
class SamlClientModel extends Model
|
|
{
|
|
protected $table = 'saml_client';
|
|
protected $primaryKey = 'id';
|
|
protected $returnType = 'array';
|
|
protected $allowedFields = [
|
|
'client_id',
|
|
'email_domain',
|
|
'saml_entity_id',
|
|
'saml_sso_url',
|
|
'saml_slo_url',
|
|
'saml_x509_cert',
|
|
];
|
|
protected $useTimestamps = true;
|
|
protected $createdField = 'created_at';
|
|
protected $updatedField = 'updated_at';
|
|
protected $dateFormat = 'datetime';
|
|
|
|
public function getByDomain(string $domain): ?array
|
|
{
|
|
$domain = strtolower(trim($domain));
|
|
|
|
return $this->where('LOWER(email_domain)', $domain)->first();
|
|
}
|
|
}
|