41 lines
730 B
PHP
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;
|
|
}
|
|
|
|
}
|