OXID eShop CE  4.8.10
 All Classes Files Functions Variables Pages
oxobject2group.php
Go to the documentation of this file.
1 <?php
2 
5 class oxObject2Group extends oxBase
6 {
12  protected $_blDisableShopCheck = true;
13 
19  protected $_sClassName = 'oxobject2group';
20 
24  public function __construct()
25  {
27  $this->init( 'oxobject2group' );
28  $this->oxobject2group__oxshopid = new oxField($this->getConfig()->getShopId(), oxField::T_RAW);
29  }
30 
36  public function save()
37  {
38  $oDb = oxDb::getDb();
39  $sQ = "select 1 from oxobject2group where oxgroupsid = ".$oDb->quote( $this->oxobject2group__oxgroupsid->value );
40  $sQ .= " and oxobjectid = ". $oDb->quote( $this->oxobject2group__oxobjectid->value );
41 
42  // does not exist
43  if ( !$oDb->getOne( $sQ, false, false ) ) {
44  return parent::save();
45  }
46  }
47 }