/** * Deletes all associated Shipments * @return void */ public function DeleteAllShipments() { if (is_null($this->intCourierId)) { throw new QUndefinedPrimaryKeyException('Unable to call UnassociateShipment on this unsaved Courier.'); } // Get the Database Object for this Class $objDatabase = Courier::GetDatabase(); // Journaling if ($objDatabase->JournalingDatabase) { foreach (Shipment::LoadArrayByCourierId($this->intCourierId) as $objShipment) { $objShipment->Journal('DELETE'); } } // Perform the SQL Query $objDatabase->NonQuery(' DELETE FROM `shipment` WHERE `courier_id` = ' . $objDatabase->SqlVariable($this->intCourierId) . ' '); }
/** * Gets all associated Shipments as an array of Shipment objects * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query * @return Shipment[] */ public function GetShipmentArray($objOptionalClauses = null) { if (is_null($this->intCourierId)) { return array(); } try { return Shipment::LoadArrayByCourierId($this->intCourierId, $objOptionalClauses); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } }