You are here

public function UcWishlistManager::selectWishlistProducts in UC Wish List 8

Any specific wish list product can be selected by invoking this function for altering/removing it.

Parameters

$wid: refers to a particular wish list id.

Return value

string select(s) a any specific wishlist product.

File

src/Database/UcWishlistManager.php, line 221

Class

UcWishlistManager
Defines an UcWishlistManager service.

Namespace

Drupal\uc_wishlist\Database

Code

public function selectWishlistProducts($wid) {
  $query = $this->connection
    ->select('node', 'n');
  $query
    ->join('uc_wishlist_products', 'w', 'n.nid = w.nid');
  $query
    ->fields('w');
  $query
    ->addField('n', 'vid');
  $query
    ->condition('w.wid', $wid);
  $query
    ->addTag('node_access');
  $query
    ->join('node_field_data', 'f', 'n.nid = f.nid');
  $query
    ->addField('f', 'title');
  $result = $query
    ->execute();
  return $result;
}