Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ========================================
- || *id* | created | user_id | post_id ||
- ========================================
- $userHasLikedThisPost = $this->Like->hasAny(array(
- 'user_id' => $this->Auth->user('id'),
- 'post_id' => $postId
- ));
- public function hasLike($postId, $userId) {
- return $this->hasAny(array(
- 'user_id' => $userId,
- 'post_id' => $postId,
- ));
- }
Add Comment
Please, Sign In to add comment