Пример #1
0
    /**
     * 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) . '
			');
    }
Пример #2
0
    /**
     * Deletes all associated ShippingAccounts
     * @return void
     */
    public function DeleteAllShippingAccounts()
    {
        if (is_null($this->intCourierId)) {
            throw new QUndefinedPrimaryKeyException('Unable to call UnassociateShippingAccount on this unsaved Courier.');
        }
        // Get the Database Object for this Class
        $objDatabase = Courier::GetDatabase();
        // Perform the SQL Query
        $objDatabase->NonQuery('
				DELETE FROM
					`shipping_account`
				WHERE
					`courier_id` = ' . $objDatabase->SqlVariable($this->intCourierId) . '
			');
    }