oxdeliveryset.php

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