<?php
namespace App\KommaApp\Shop\Properties\Models;
use App\KommaApp\Kms\Core\AbstractTranslatableModel;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
/**
* Class PropertyValue
*
* @property-read integer $id
* @property-read integer $property_id
*
* Represents a property value that could be for example "green".
* It does not represent the key that could for example be "color".
* The translations associated to it would be in the case of "green",
* the translations for the word "green" in multiple languages.
* @package App\KommaApp\Shop\Properties\Models
* @property \Carbon\Carbon|null $created_at
* @property \Carbon\Carbon|null $updated_at
* @property-read \App\KommaApp\Shop\Properties\Models\Property $property
* @property-read \App\KommaApp\Shop\Properties\Models\PropertyValueTranslation $translation
* @property-read \Illuminate\Database\Eloquent\Collection|\App\KommaApp\Shop\Properties\Models\PropertyValueTranslation[] $translations
* @method static \Illuminate\Database\Eloquent\Builder|\App\KommaApp\Shop\Properties\Models\PropertyValue whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\KommaApp\Shop\Properties\Models\PropertyValue whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\KommaApp\Shop\Properties\Models\PropertyValue whereUpdatedAt($value)
* @mixin \Eloquent
*/
class PropertyValue extends AbstractTranslatableModel
{
//Transient property
public $thumbnail;
/**
* Gets the translation models for this model
*
* @return HasMany that resolves to AbstractTranslationModel instances
*/
public function translations(): HasMany
{
return $this->hasMany(PropertyValueTranslation::class);
}
function property():HasOne
{
return $this->HasOne(Property::class);
}
}