🚀 مُصادَق: الإطلاق الأولي للنظام المتكامل
This commit is contained in:
19
app/Modules/Companies/CompanyModel.php
Normal file
19
app/Modules/Companies/CompanyModel.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Companies;
|
||||
|
||||
use App\Models\BaseModel;
|
||||
|
||||
final class CompanyModel extends BaseModel
|
||||
{
|
||||
protected string $table = 'companies';
|
||||
|
||||
public function findByTenant(string $tenantId): array
|
||||
{
|
||||
$stmt = $this->db()->prepare("SELECT * FROM {$this->table} WHERE tenant_id = ? AND deleted_at IS NULL");
|
||||
$stmt->execute([$tenantId]);
|
||||
return $stmt->fetchAll();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user