OrderState references a contact ID rather than a user.
Foreign keys must be explicitly set as NULL from Propel.
$hub_id = $_POST['hub_id'];
$quantity = $_POST['quantity'];
$driver_id = $_POST['driver_id'];
+ if (! $driver_id) $driver_id = null;
$state = $_POST['state'];
if (! $state) $state = $GLOBALS['STATE_PLACED'];
return false;
}
}
+ else $hub_id = null;
if (! is_numeric($quantity)) {
echo "<p>Invalid quantity!</p>\n";
<reference local="order_id" foreign="id"/>
</foreign-key>
<foreign-key foreignTable="User" phpName="User" refPhpName="OrderState">
- <reference local="user_id" foreign="id"/>
+ <reference local="user_id" foreign="contact_id"/>
</foreign-key>
<foreign-key foreignTable="Contact" phpName="Driver" refPhpName="OrderState">
<reference local="driver_id" foreign="id"/>