fork download
  1. <?php
  2.  
  3. class UserRepository
  4. {
  5. /**
  6.   * @param $productId
  7.   * @return iterable|User[]
  8.   */
  9. public function getAllByProductInWishList($productId): iterable
  10. {
  11. return User::find()
  12. ->alias('u')
  13. ->joinWith('wishlistItems w', false, 'INNER JOIN')
  14. ->andWhere(['w.product_id' => $productId])
  15. ->each();
  16. }
  17. }
Success #stdin #stdout 0.02s 23160KB
stdin
Standard input is empty
stdout
Standard output is empty