Guest User

Untitled

a guest
Jan 19th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. ========================================
  2. || *id* | created | user_id | post_id ||
  3. ========================================
  4.  
  5. $userHasLikedThisPost = $this->Like->hasAny(array(
  6. 'user_id' => $this->Auth->user('id'),
  7. 'post_id' => $postId
  8. ));
  9.  
  10. public function hasLike($postId, $userId) {
  11. return $this->hasAny(array(
  12. 'user_id' => $userId,
  13. 'post_id' => $postId,
  14. ));
  15. }
Add Comment
Please, Sign In to add comment