/**
  * default constructor
  *
  * @param array $record      array of field values
  * @param bool  $isSingleton true if this is a singleton() object
  *
  * @return void
  *
  * @author Sebastian Diel <*****@*****.**>
  * @since 15.11.2014
  */
 public function __construct($record = null, $isSingleton = false)
 {
     parent::__construct($record, $isSingleton);
     if ($this->ID > 0) {
         if (!SilvercartTools::isIsolatedEnvironment() && !SilvercartTools::isBackendEnvironment()) {
             // Initialize shopping cart position object, so that it can inject
             // its forms into the controller.
             if (self::$loadModules) {
                 foreach ($this->SilvercartShoppingCartPositions() as $position) {
                     $position->registerCustomHtmlForms();
                 }
             }
             if (!self::$cartCleaningFinished && !self::$cartCleaningInProgress) {
                 self::$cartCleaningInProgress = true;
                 $this->cleanUp();
             }
             $this->SilvercartShippingMethodID = 0;
             $this->SilvercartPaymentMethodID = 0;
             if (Member::currentUserID() && self::$loadModules) {
                 $this->callMethodOnRegisteredModules('performShoppingCartConditionsCheck', array($this, SilvercartCustomer::currentUser()));
                 $this->callMethodOnRegisteredModules('ShoppingCartInit', array($this));
             }
         }
     }
 }