This repository has been archived by the owner on Apr 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from mybb/feature-modcp
Moderator CP: Logs and approval queue
- Loading branch information
Showing
81 changed files
with
1,680 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* @author MyBB Group | ||
* @version 2.0.0 | ||
* @package mybb/core | ||
* @license http://www.mybb.com/licenses/bsd3 BSD-3 | ||
*/ | ||
|
||
namespace MyBB\Core\Content; | ||
|
||
interface ContentInterface | ||
{ | ||
/** | ||
* @return int | ||
*/ | ||
public function getId(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getType(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getUrl(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getTitle(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
/** | ||
* @author MyBB Group | ||
* @version 2.0.0 | ||
* @package mybb/core | ||
* @license http://www.mybb.com/licenses/bsd3 BSD-3 | ||
*/ | ||
|
||
namespace MyBB\Core\Database\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
use McCool\LaravelAutoPresenter\HasPresenter; | ||
|
||
/** | ||
* @property int id | ||
* @property string moderation | ||
* @property string destination_content_type | ||
* @property int destination_content_id | ||
* @property string source_content_type | ||
* @property int source_content_id | ||
*/ | ||
class ModerationLog extends Model implements HasPresenter | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $table = 'moderation_logs'; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected $guarded = ['id']; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected $casts = [ | ||
'id' => 'int', | ||
'destination_content_id' => 'int', | ||
'source_content_id' => 'int' | ||
]; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected $dates = ['created_at']; | ||
|
||
/** | ||
* Get the presenter class. | ||
* | ||
* @return string | ||
*/ | ||
public function getPresenterClass() | ||
{ | ||
return 'MyBB\Core\Presenters\ModerationLogPresenter'; | ||
} | ||
|
||
/** | ||
* @return \Illuminate\Database\Eloquent\Relations\HasMany | ||
*/ | ||
public function subjects() | ||
{ | ||
return $this->hasMany('MyBB\Core\Database\Models\ModerationLogSubject'); | ||
} | ||
|
||
/** | ||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo | ||
*/ | ||
public function user() | ||
{ | ||
return $this->belongsTo('MyBB\Core\Database\Models\User'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
/** | ||
* @author MyBB Group | ||
* @version 2.0.0 | ||
* @package mybb/core | ||
* @license http://www.mybb.com/licenses/bsd3 BSD-3 | ||
*/ | ||
|
||
namespace MyBB\Core\Database\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class ModerationLogSubject extends Model | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $table = 'moderation_log_subjects'; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected $guarded = ['id']; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
app/Database/Repositories/Eloquent/ModerationLogRepository.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* @author MyBB Group | ||
* @version 2.0.0 | ||
* @package mybb/core | ||
* @license http://www.mybb.com/licenses/bsd3 BSD-3 | ||
*/ | ||
|
||
namespace MyBB\Core\Database\Repositories\Eloquent; | ||
|
||
use MyBB\Core\Database\Models\ModerationLog; | ||
use MyBB\Core\Database\Repositories\ModerationLogRepositoryInterface; | ||
|
||
class ModerationLogRepository implements ModerationLogRepositoryInterface | ||
{ | ||
/** | ||
* @var ModerationLog | ||
*/ | ||
protected $moderationLog; | ||
|
||
/** | ||
* @param ModerationLog $moderationLog | ||
*/ | ||
public function __construct(ModerationLog $moderationLog) | ||
{ | ||
$this->moderationLog = $moderationLog; | ||
} | ||
|
||
/** | ||
* @param int $id | ||
* | ||
* @return ModerationLog | ||
*/ | ||
public function find($id) | ||
{ | ||
return $this->moderationLog->find($id); | ||
} | ||
|
||
/** | ||
* @param array $attributes | ||
* | ||
* @return ModerationLog | ||
*/ | ||
public function create(array $attributes) | ||
{ | ||
return $this->moderationLog->create($attributes); | ||
} | ||
} |
Oops, something went wrong.