Removed Relationship

This commit is contained in:
devansh bawari 2021-06-30 11:50:55 +05:30
parent 8858ed64ff
commit 4b99cf7ee2
1 changed files with 13 additions and 11 deletions

View File

@ -4,14 +4,20 @@ namespace Webkul\Product\Models;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Webkul\Attribute\Models\AttributeProxy; use Webkul\Attribute\Models\AttributeProxy;
use Webkul\Channel\Models\ChannelProxy;
use Webkul\Product\Contracts\ProductAttributeValue as ProductAttributeValueContract; use Webkul\Product\Contracts\ProductAttributeValue as ProductAttributeValueContract;
class ProductAttributeValue extends Model implements ProductAttributeValueContract class ProductAttributeValue extends Model implements ProductAttributeValueContract
{ {
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = false; public $timestamps = false;
/** /**
* Attribute type fields.
*
* @var array * @var array
*/ */
public static $attributeTypeFields = [ public static $attributeTypeFields = [
@ -28,10 +34,14 @@ class ProductAttributeValue extends Model implements ProductAttributeValueContra
'checkbox' => 'text_value', 'checkbox' => 'text_value',
]; ];
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [ protected $fillable = [
'product_id', 'product_id',
'attribute_id', 'attribute_id',
'channel_id',
'locale', 'locale',
'channel', 'channel',
'text_value', 'text_value',
@ -58,12 +68,4 @@ class ProductAttributeValue extends Model implements ProductAttributeValueContra
{ {
return $this->belongsTo(ProductProxy::modelClass()); return $this->belongsTo(ProductProxy::modelClass());
} }
/**
* Get the channel that owns the attribute value.
*/
public function channel()
{
return $this->belongsTo(ChannelProxy::modelClass());
}
} }