Added contact page
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Managers;
|
||||
|
||||
use App\Models\Loaders\UsersLoader;
|
||||
use App\Models\Objects\Contact;
|
||||
|
||||
class ContactManager
|
||||
{
|
||||
private string $imgDir;
|
||||
|
||||
public function __construct(
|
||||
private UsersLoader $usersLoader,
|
||||
) {
|
||||
$this->imgDir = config('directories.images');
|
||||
}
|
||||
|
||||
public function getContacts(): array
|
||||
{
|
||||
$data = $this->usersLoader->getContacts();
|
||||
|
||||
$contacts = [];
|
||||
foreach($data as $row) {
|
||||
$contact = new Contact();
|
||||
$contact->setImgPath($this->imgDir);
|
||||
$contact->setAttributes($row);
|
||||
$contacts[] = $contact;
|
||||
}
|
||||
|
||||
return $contacts;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user