Created
October 19, 2019 14:04
-
-
Save kailasnarendran/ef0bb5536cb9d13a97e5ac3ad4d82252 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ShipmentHandlingUnitsTable extends Table | |
{.... | |
public function initialize(array $config) | |
{ | |
... | |
$this->belongsToMany('OrderLines', [ | |
'foreignKey' => 'shipment_handling_unit_id', | |
'targetForeignKey' => 'order_line_id', | |
'joinTable' => 'order_lines_shipment_handling_units' | |
]); | |
} | |
------------- | |
class ShipmentsTable extends Table | |
{ | |
... | |
public function initialize(array $config) | |
{ | |
... | |
$this->hasMany('ShipmentHandlingUnits', [ | |
'foreignKey' => 'shipment_id' | |
]); | |
} | |
------- | |
$shipment = $this->Shipments->patchEntity($shipment, $this->request->getData(),['associated'=>['ShipmentHandlingUnits.OrderLines']]); | |
---- | |
echo $this->Form->input("shipment_handling_units[0].order_lines[$i]._joinData.order_line_id",['type'=>'hidden','value'=>$orderLine->id]); | |
echo $this->Form->input("shipment_handling_units[0].order_lines[$i]._joinData.qty",['label'=>'']); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment