Studio: make grid checkbox rectangular and commit table changes
This commit is contained in:
54
app/Models/RecItemPair.php
Normal file
54
app/Models/RecItemPair.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Item-item co-occurrence pair for behavior-based similarity.
|
||||
*
|
||||
* @property int $a_artwork_id
|
||||
* @property int $b_artwork_id
|
||||
* @property float $weight
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
*
|
||||
* @property-read Artwork $artworkA
|
||||
* @property-read Artwork $artworkB
|
||||
*/
|
||||
final class RecItemPair extends Model
|
||||
{
|
||||
protected $table = 'rec_item_pairs';
|
||||
|
||||
public $incrementing = false;
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'a_artwork_id',
|
||||
'b_artwork_id',
|
||||
'weight',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'a_artwork_id' => 'integer',
|
||||
'b_artwork_id' => 'integer',
|
||||
'weight' => 'double',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
|
||||
// ── Relations ──────────────────────────────────────────────────────────
|
||||
|
||||
public function artworkA(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Artwork::class, 'a_artwork_id');
|
||||
}
|
||||
|
||||
public function artworkB(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Artwork::class, 'b_artwork_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user