OXID eShop CE  4.8.12
 All Classes Files Functions Variables Pages
oxdeliveryset.php
Go to the documentation of this file.
1 <?php
2 
8 class oxDeliverySet extends oxI18n
9 {
15  protected $_sClassName = 'oxdeliveryset';
16 
20  public function __construct()
21  {
23  $this->init( 'oxdeliveryset' );
24  }
25 
33  public function delete( $sOxId = null )
34  {
35  if ( !$sOxId ) {
36  $sOxId = $this->getId();
37  }
38  if ( !$sOxId ) {
39  return false;
40  }
41 
42 
43  $oDb = oxDb::getDb();
44 
45  $sOxidQuoted = $oDb->quote($sOxId);
46  $oDb->execute( 'delete from oxobject2payment where oxobjectid = '.$sOxidQuoted );
47  $oDb->execute( 'delete from oxobject2delivery where oxdeliveryid = '.$sOxidQuoted);
48  $oDb->execute( 'delete from oxdel2delset where oxdelsetid = '.$sOxidQuoted);
49 
50  return parent::delete( $sOxId );
51  }
52 
60  public function getIdByName( $sTitle )
61  {
62  $oDb = oxDb::getDb();
63  $sQ = "SELECT `oxid` FROM `" . getViewName( 'oxdeliveryset' ) . "` WHERE `oxtitle` = " . $oDb->quote( $sTitle );
64  $sId = $oDb->getOne( $sQ );
65 
66  return $sId;
67  }
68 }