You are here

public function UcWishlistManager::getAllWishlist in UC Wish List 8

This function retrieves a list of wish lists created by a specific user based on the wid, uid, wish list title and expiration status.

Return value

\Drupal\Core\Database\StatementInterface[] List of wish lists created by any particular user.

File

src/Database/UcWishlistManager.php, line 37

Class

UcWishlistManager
Defines an UcWishlistManager service.

Namespace

Drupal\uc_wishlist\Database

Code

public function getAllWishlist() {
  $query = $this->connection
    ->select('uc_wishlists', 'w');
  $query
    ->leftJoin('users', 'u', 'w.uid = u.uid');
  $query
    ->fields('w', [
    'wid',
    'uid',
    'title',
    'expiration',
  ]);
  $result = $query
    ->execute();

  /**
   * @todo
   * extend default pager limit
   * $query->extend('PagerDefault')->limit(25)->execute();
   */
  return $result;
}