OXID eShop CE  4.8.12
 All Classes Files Functions Variables Pages
oxgroups.php
Go to the documentation of this file.
1 <?php
2 
8 class oxGroups extends oxI18n
9 {
14  protected $_sClassName = 'oxgroups';
15 
19  public function __construct()
20  {
22  $this->init( 'oxgroups' );
23  }
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 
44  parent::delete( $sOXID );
45 
46  $oDb = oxDb::getDb();
47 
48 
49  // deleting related data records
50  $sDelete = 'delete from oxobject2group where oxobject2group.oxgroupsid = ' . $oDb->quote( $sOXID );
51  $rs = $oDb->execute( $sDelete );
52 
53  $sDelete = 'delete from oxobject2delivery where oxobject2delivery.oxobjectid = ' . $oDb->quote( $sOXID );
54  $rs = $oDb->execute( $sDelete );
55 
56  $sDelete = 'delete from oxobject2discount where oxobject2discount.oxobjectid = ' . $oDb->quote( $sOXID );
57  $rs = $oDb->execute( $sDelete );
58 
59  $sDelete = 'delete from oxobject2payment where oxobject2payment.oxobjectid = ' . $oDb->quote( $sOXID );
60  $rs = $oDb->execute( $sDelete );
61 
62  return $rs->EOF;
63  }
64 
65 }