22 lines
475 B
PHP
22 lines
475 B
PHP
<?php
|
|
|
|
namespace App\Repositories\Member;
|
|
|
|
use App\Models\Member\MemInfo;
|
|
|
|
class MemInfoRepository
|
|
{
|
|
public function findByMemNo(int $memNo): ?MemInfo
|
|
{
|
|
return MemInfo::query()->where('mem_no', $memNo)->first();
|
|
}
|
|
|
|
public function emailsMatch(int $memNo, string $email): bool
|
|
{
|
|
$mem = $this->findByMemNo($memNo);
|
|
if (!$mem || empty($mem->email)) return false;
|
|
|
|
return strcasecmp((string)$mem->email, $email) === 0;
|
|
}
|
|
}
|