original_string: protected function controlProductsCompare()
      {
          $options = array(
              'status' => 1,
              'store_id' => $this->store_id,
              'product_id' => $this->product_compare->getList()
          );
  
          if (!empty($options['product_id'])) {
              $existing = array_keys($this->product->getList($options));
              if (array_diff($options['product_id'], $existing)) {
                  $this->product_compare->set($existing);
              }
          }
      }
code: protected function controlProductsCompare()
      {
          $options = array(
              'status' => 1,
              'store_id' => $this->store_id,
              'product_id' => $this->product_compare->getList()
          );
  
          if (!empty($options['product_id'])) {
              $existing = array_keys($this->product->getList($options));
              if (array_diff($options['product_id'], $existing)) {
                  $this->product_compare->set($existing);
              }
          }
      }
code_tokens: protected function controlProductsCompare ( ) { $ options = array ( 'status' => 1 , 'store_id' => $ this -> store_id , 'product_id' => $ this -> product_compare -> getList ( ) ) ; if ( ! empty ( $ options [ 'product_id' ] ) ) { $ existing = array_keys ( $ this -> product -> getList ( $ options ) ) ; if ( array_diff ( $ options [ 'product_id' ] , $ existing ) ) { $ this -> product_compare -> set ( $ existing ) ; } } }
docstring: Make sure that products saved in cookie are all valid and available to the user
  If some products were removed, disabled or moved to another store they will be removes from cookie
docstring_tokens: Make sure that products saved in cookie are all valid and available to the user If some products were removed disabled or moved to another store they will be removes from cookie