Changeset View
Standalone View
src/app/Fs/Relation.php
- This file was added.
<?php | |||||
namespace App\Fs; | |||||
use Illuminate\Database\Eloquent\Model; | |||||
/** | |||||
* The eloquent definition of a filesystem relation. | |||||
* | |||||
* @property string $id Relation identifier | |||||
machniak: s/item/relation/ | |||||
* @property string $item_id Item identifier | |||||
* @property string $related_id Related item identifier | |||||
*/ | |||||
Done Inline ActionsMissing $item property. I'm also not sure about these column names. It looks to me that it might get confusing and/or harder to use if we create a record that has item=collection_id,related=file_id and another with item=file_id,related=collection_id. Also in fs_properties we have item_id column, so here it also should be item_id not item. machniak: Missing $item property.
I'm also not sure about these column names. It looks to me that it… | |||||
Done Inline ActionsI agree that relating collections to items doesn't currently make much sense, perhaps it does in the future with a relation-type introduced (but for now we just don't). I think the non-confusing approach would be to completely separate files and collections and not have the generic item concept. We went with the item concept because we liked that it's generic and it's potential performance benefits for queries. IMO it's manageable as it is, so I'm not too worried about it. mollekopf: I agree that relating collections to items doesn't currently make much sense, perhaps it does… | |||||
class Relation extends Model | |||||
{ | |||||
/** @var array<int, string> The attributes that are mass assignable */ | |||||
protected $fillable = ['item_id', 'related_id']; | |||||
/** @var string Database table name */ | |||||
protected $table = 'fs_relations'; | |||||
} |
s/item/relation/