original_string: protected function updateCategories(Collection $data)
  	{
  		$ids = explode(',', $this->preferences['product_categories']);
  
  		$categories = Collection::make($ids)
  			->merge($data)
  			->unique()
  			->take(self::MAX_TAGS)
  			->implode(',');
  
  		$this->preferences['product_categories'] = trim($categories, ',');
  	}
code: protected function updateCategories(Collection $data)
  	{
  		$ids = explode(',', $this->preferences['product_categories']);
  
  		$categories = Collection::make($ids)
  			->merge($data)
  			->unique()
  			->take(self::MAX_TAGS)
  			->implode(',');
  
  		$this->preferences['product_categories'] = trim($categories, ',');
  	}
code_tokens: protected function updateCategories ( Collection $ data ) { $ ids = explode ( ',' , $ this -> preferences [ 'product_categories' ] ) ; $ categories = Collection :: make ( $ ids ) -> merge ( $ data ) -> unique ( ) -> take ( self :: MAX_TAGS ) -> implode ( ',' ) ; $ this -> preferences [ 'product_categories' ] = trim ( $ categories , ',' ) ; }
docstring: Updates the user categories key with the given collection.
  
  @param  Collection $data
  
  @return void
docstring_tokens: Updates the user categories key with the given collection .