oxobject2group.php

Go to the documentation of this file.
00001 <?php
00002 
00005 class oxObject2Group extends oxBase
00006 {
00012     protected $_blDisableShopCheck = true;
00013 
00019     protected $_sClassName = 'oxobject2group';
00020 
00024     public function __construct()
00025     {
00026         parent::__construct();
00027         $this->init( 'oxobject2group' );
00028         $this->oxobject2group__oxshopid = new oxField($this->getConfig()->getShopId(), oxField::T_RAW);
00029     }
00030 
00036     public function save()
00037     {
00038         $oDb = oxDb::getDb();
00039         $sQ  = "select 1 from oxobject2group where oxgroupsid = ".$oDb->quote( $this->oxobject2group__oxgroupsid->value );
00040         $sQ .= " and oxobjectid = ". $oDb->quote( $this->oxobject2group__oxobjectid->value );
00041 
00042         // does not exist
00043         if ( !$oDb->getOne( $sQ, false, false ) ) {
00044             return parent::save();
00045         }
00046     }
00047 }