/** * Deletes all associated Shortcuts * @return void */ public function DeleteAllShortcuts() { if (is_null($this->intTransactionTypeId)) { throw new QUndefinedPrimaryKeyException('Unable to call UnassociateShortcut on this unsaved TransactionType.'); } // Get the Database Object for this Class $objDatabase = TransactionType::GetDatabase(); // Journaling if ($objDatabase->JournalingDatabase) { foreach (Shortcut::LoadArrayByTransactionTypeId($this->intTransactionTypeId) as $objShortcut) { $objShortcut->Journal('DELETE'); } } // Perform the SQL Query $objDatabase->NonQuery(' DELETE FROM `shortcut` WHERE `transaction_type_id` = ' . $objDatabase->SqlVariable($this->intTransactionTypeId) . ' '); }