Skip to content

Commit 3ae1e11

Browse files
committed
Fixing trait correctly
1 parent 7d33e77 commit 3ae1e11

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"src/views"
2929
],
3030
"psr-0": {
31-
"Syntax\\Forum\\": "src/"
31+
"Syntax\\Forum\\": "src/Syntax/Forum"
3232
}
3333
},
3434
"extra": {

src/Syntax/Forum/Traits/ForumableUserTrait.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php namespace Syntax\Core\Traits;
1+
<?php namespace Syntax\Forum\Traits;
22

33
class ForumableUserTrait {
44

@@ -25,17 +25,17 @@ public function checkUnreadBoard($boardId)
2525
// return Forum_Board::where('id', '=', $boardId)->or_where('parent_id', '=', $boardId)->get()->unreadFlagForUser($this->id);
2626

2727
// Get all parent and child boards matching the id
28-
$boardIds = Forum_Board::where('uniqueId', $boardId)->orWhere('parent_id', '=', $boardId)->get()->id->toArray();
28+
$boardIds = \Forum_Board::where('uniqueId', $boardId)->orWhere('parent_id', '=', $boardId)->get()->id->toArray();
2929

3030
// Get any posts within those boards
31-
$posts = Forum_Post::whereIn('forum_board_id', $boardIds)->get();
31+
$posts = \Forum_Post::whereIn('forum_board_id', $boardIds)->get();
3232
$postIds = $posts->id->toArray();
3333

3434
// Make sure there are posts
3535
if (count($postIds) > 0) {
3636

3737
// See which of these posts the user has already viewed
38-
$viewedPosts = Forum_Post_View::where('user_id', '=', $this->id)->whereIn('forum_post_id', $postIds)->get();
38+
$viewedPosts = \Forum_Post_View::where('user_id', '=', $this->id)->whereIn('forum_post_id', $postIds)->get();
3939

4040
// If the posts are greater than the viewed, there are new posts
4141
if (count($posts) > count($viewedPosts)) {
@@ -53,7 +53,7 @@ public function checkUnreadBoard($boardId)
5353
public function unreadPostCount()
5454
{
5555
// Get the id of all posts
56-
$posts = Forum_Post::all();
56+
$posts = \Forum_Post::all();
5757
$postsCount = $posts->count();
5858

5959
if ($postsCount > 0) {
@@ -65,7 +65,7 @@ public function unreadPostCount()
6565
$postIds = $posts->id->toArray();
6666

6767
// See which of these the user has viewed
68-
$viewedPostCount = Forum_Post_View::where('user_id', $this->id)->whereIn('forum_post_id', $postIds)->count();
68+
$viewedPostCount = \Forum_Post_View::where('user_id', $this->id)->whereIn('forum_post_id', $postIds)->count();
6969

7070
// If there are more posts than viewed posts, return the remainder
7171
if ($postsCount > $viewedPostCount) {

0 commit comments

Comments
 (0)