oxdeliveryset.php

Go to the documentation of this file.
00001 <?php
00002 
00008 class oxDeliverySet extends oxI18n
00009 {
00015     protected $_sClassName = 'oxdeliveryset';
00016 
00020     public function __construct()
00021     {
00022         parent::__construct();
00023         $this->init( 'oxdeliveryset' );
00024     }
00025 
00033     public function delete( $sOxId = null )
00034     {
00035         if ( !$sOxId ) {
00036             $sOxId = $this->getId();
00037         }
00038         if ( !$sOxId ) {
00039             return false;
00040         }
00041 
00042 
00043         $oDb = oxDb::getDb();
00044 
00045         $sOxidQuoted = $oDb->quote($sOxId);
00046         $oDb->execute( 'delete from oxobject2payment where oxobjectid = '.$sOxidQuoted );
00047         $oDb->execute( 'delete from oxobject2delivery where oxdeliveryid = '.$sOxidQuoted);
00048         $oDb->execute( 'delete from oxdel2delset where oxdelsetid = '.$sOxidQuoted);
00049 
00050         return parent::delete( $sOxId );
00051     }
00052 
00060     public function getIdByName( $sTitle )
00061     {
00062         $oDb = oxDb::getDb();
00063         $sQ = "SELECT `oxid` FROM `" . getViewName( 'oxdeliveryset' ) . "` WHERE  `oxtitle` = " . $oDb->quote( $sTitle );
00064         $sId = $oDb->getOne( $sQ );
00065 
00066         return $sId;
00067     }
00068 }