Merge pull request #5076 from devansh-webkul/non-existent-relationsship

Removed Child Relationship For Shipment Item #4993
This commit is contained in:
Glenn Hermans 2021-08-13 10:23:12 +02:00 committed by GitHub
commit 06608c17fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 12 deletions

View File

@ -7,6 +7,11 @@ use Webkul\Sales\Contracts\ShipmentItem as ShipmentItemContract;
class ShipmentItem extends Model implements ShipmentItemContract
{
/**
* The attributes that aren't mass assignable.
*
* @var string[]|bool
*/
protected $guarded = [
'id',
'child',
@ -14,12 +19,17 @@ class ShipmentItem extends Model implements ShipmentItemContract
'updated_at',
];
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'additional' => 'array',
];
/**
* Retrieve type instance
* Retrieve type instance.
*
* @return AbstractType
*/
@ -27,7 +37,7 @@ class ShipmentItem extends Model implements ShipmentItemContract
{
return $this->order_item->getTypeInstance();
}
/**
* Get the shipment record associated with the shipment item.
*/
@ -53,18 +63,10 @@ class ShipmentItem extends Model implements ShipmentItemContract
}
/**
* Get the child item record associated with the shipment item.
*/
public function child()
{
return $this->belongsTo(ShipmentItemProxy::modelClass(), 'parent_id');
}
/**
* Get order item type
* Get order item type.
*/
public function getTypeAttribute()
{
return $this->order_item->type;
}
}
}