Merge pull request #4986 from devansh-webkul/product-attribute-relation

Removed Channel Relationship From The ProductAttributeValues Model #4985
This commit is contained in:
Jitendra Singh 2021-06-30 13:23:42 +05:30 committed by GitHub
commit 99ae5942ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 Webkul\Attribute\Models\AttributeProxy;
use Webkul\Channel\Models\ChannelProxy;
use Webkul\Product\Contracts\ProductAttributeValue as ProductAttributeValueContract;
class ProductAttributeValue extends Model implements ProductAttributeValueContract
{
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = false;
/**
* Attribute type fields.
*
* @var array
*/
public static $attributeTypeFields = [
@ -28,10 +34,14 @@ class ProductAttributeValue extends Model implements ProductAttributeValueContra
'checkbox' => 'text_value',
];
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'product_id',
'attribute_id',
'channel_id',
'locale',
'channel',
'text_value',
@ -58,12 +68,4 @@ class ProductAttributeValue extends Model implements ProductAttributeValueContra
{
return $this->belongsTo(ProductProxy::modelClass());
}
/**
* Get the channel that owns the attribute value.
*/
public function channel()
{
return $this->belongsTo(ChannelProxy::modelClass());
}
}
}