Files
opensem/app/Repositories/Core/Comments.php
2021-07-27 22:12:58 +02:00

41 lines
730 B
PHP

<?php
namespace App\Repositories\Core;
class Comments
{
public static function getByModel($model)
{
if (!$model) {
return false;
}
return $model->comments;
}
public static function storeComments($model, $comments)
{
if ($comments) {
foreach ($comments as $comment) {
self::storeComment($model, $comment);
}
}
}
public static function storeComment($model, $comment)
{
return $model->comment($comment);
}
public static function deleteComments($model)
{
return true;
}
public static function deleteComment($model, $index)
{
return true;
}
}