44 lines
993 B
PHP
44 lines
993 B
PHP
<?php
|
|
|
|
namespace Modules\PMS\Repositories;
|
|
|
|
use Modules\PMS\Models\KanbanColumn;
|
|
|
|
class KanbanColumnRepository implements KanbanColumnInterface
|
|
{
|
|
public function findAll()
|
|
{
|
|
return KanbanColumn::orderBy('position')->get();
|
|
}
|
|
|
|
public function getKanbanColumnById($TaskCategoryId)
|
|
{
|
|
return KanbanColumn::findOrFail($TaskCategoryId);
|
|
}
|
|
|
|
public function delete($TaskCategoryId)
|
|
{
|
|
KanbanColumn::destroy($TaskCategoryId);
|
|
}
|
|
|
|
public function create($TaskCategoryDetails)
|
|
{
|
|
return KanbanColumn::create($TaskCategoryDetails);
|
|
}
|
|
|
|
public function update($TaskCategoryId, array $newDetails)
|
|
{
|
|
return KanbanColumn::whereId($TaskCategoryId)->update($newDetails);
|
|
}
|
|
|
|
public function pluck(callable $query = null)
|
|
{
|
|
$baseQuery = KanbanColumn::query();
|
|
if (is_callable($query)) {
|
|
$query($baseQuery);
|
|
}
|
|
|
|
return $baseQuery->pluck('name', 'id')->all();
|
|
}
|
|
}
|