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