datatable.directory codebase https://datatable.directory/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
datatable.directory/app/Models/TableComment.php

36 lines
703 B

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* Comment on a data table
*/
class TableComment extends Model
{
/** Context data table */
6 years ago
public function table()
{
6 years ago
return $this->belongsTo(Table::class);
}
/** Parent comment (that we reply to; can be null) */
public function ancestor()
{
return $this->belongsTo(TableComment::class, 'ancestor_id');
}
/** Replies to this comment */
public function replies()
{
return $this->hasMany(TableComment::class, 'ancestor_id');
}
/** Authoring user */
public function author()
{
return $this->belongsTo(User::class, 'author_id');
}
}