first commit
This commit is contained in:
0
Modules/Meeting/app/Repositories/.gitkeep
Normal file
0
Modules/Meeting/app/Repositories/.gitkeep
Normal file
12
Modules/Meeting/app/Repositories/MeetingInterface.php
Normal file
12
Modules/Meeting/app/Repositories/MeetingInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Meeting\Repositories;
|
||||
|
||||
interface MeetingInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getMeetingById($meetingId);
|
||||
public function delete($meetingId);
|
||||
public function create(array $meetingDetails);
|
||||
public function update($meetingId, array $newDetails);
|
||||
}
|
35
Modules/Meeting/app/Repositories/MeetingRepository.php
Normal file
35
Modules/Meeting/app/Repositories/MeetingRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Meeting\Repositories;
|
||||
|
||||
use Modules\Meeting\Models\Meeting;
|
||||
|
||||
|
||||
class MeetingRepository implements MeetingInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Meeting::get();
|
||||
}
|
||||
|
||||
public function getMeetingById($meetingId)
|
||||
{
|
||||
return Meeting::findOrFail($meetingId);
|
||||
}
|
||||
|
||||
public function delete($meetingId)
|
||||
{
|
||||
Meeting::destroy($meetingId);
|
||||
}
|
||||
|
||||
public function create(array $meetingDetails)
|
||||
{
|
||||
return Meeting::create($meetingDetails);
|
||||
}
|
||||
|
||||
public function update($meetingId, array $newDetails)
|
||||
{
|
||||
return Meeting::whereId($meetingId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user