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