OXID eShop CE  4.10.7
 All Classes Namespaces Files Functions Variables Pages
oxdeliveryset.php
Go to the documentation of this file.
1 <?php
2 
7 class oxDeliverySet extends oxI18n
8 {
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 }