From ebef4c5bc36717751806e6d31a0e10bfab0369ca Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 1 Dec 2019 01:32:20 +0100 Subject: [PATCH] Models: Updated docs --- src/Models/BaseModel.php | 5 +++++ src/Models/News.php | 1 + src/Models/NewsComment.php | 9 +++++---- src/Models/User/User.php | 5 ++++- src/Models/User/UsesUserModel.php | 2 +- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/Models/BaseModel.php b/src/Models/BaseModel.php index 6251929c..c5cb40cd 100644 --- a/src/Models/BaseModel.php +++ b/src/Models/BaseModel.php @@ -4,9 +4,14 @@ namespace Engelsystem\Models; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Query\Builder as QueryBuilder; /** * @mixin Builder + * + * @method static QueryBuilder newModelQuery() + * @method static QueryBuilder newQuery() + * @method static QueryBuilder query() */ abstract class BaseModel extends Model { diff --git a/src/Models/News.php b/src/Models/News.php index febaae3a..19a3208c 100644 --- a/src/Models/News.php +++ b/src/Models/News.php @@ -19,6 +19,7 @@ use Illuminate\Database\Query\Builder as QueryBuilder; * @property Carbon|null $updated_at * * @property-read Collection|NewsComment[] $comments + * @property-read int|null $comments_count * * @method static QueryBuilder|LogEntry[] whereId($value) * @method static QueryBuilder|LogEntry[] whereTitle($value) diff --git a/src/Models/NewsComment.php b/src/Models/NewsComment.php index c2697350..447d980f 100644 --- a/src/Models/NewsComment.php +++ b/src/Models/NewsComment.php @@ -19,10 +19,11 @@ use Illuminate\Database\Query\Builder as QueryBuilder; * @property Carbon|null $created_at * @property Carbon|null $updated_at * - * @method static QueryBuilder|LogEntry[] whereId($value) - * @method static QueryBuilder|LogEntry[] whereText($value) - * @method static QueryBuilder|LogEntry[] whereCreatedAt($value) - * @method static QueryBuilder|LogEntry[] whereUpdatedAt($value) + * @method static QueryBuilder|NewsComment[] whereId($value) + * @method static QueryBuilder|NewsComment[] whereNewsId($value) + * @method static QueryBuilder|NewsComment[] whereText($value) + * @method static QueryBuilder|NewsComment[] whereCreatedAt($value) + * @method static QueryBuilder|NewsComment[] whereUpdatedAt($value) */ class NewsComment extends BaseModel { diff --git a/src/Models/User/User.php b/src/Models/User/User.php index 6db4de7e..11d88505 100644 --- a/src/Models/User/User.php +++ b/src/Models/User/User.php @@ -25,9 +25,12 @@ use Illuminate\Database\Query\Builder as QueryBuilder; * @property-read QueryBuilder|PersonalData $personalData * @property-read QueryBuilder|Settings $settings * @property-read QueryBuilder|State $state + * @property-read Collection|News[] $news * @property-read Collection|NewsComment[] $newsComments + * @property-read int|null $news_count + * @property-read int|null $news_comments_count * - * @method static QueryBuilder|User whereId($value) + * @method static QueryBuilder|User[] whereId($value) * @method static QueryBuilder|User[] whereName($value) * @method static QueryBuilder|User[] whereEmail($value) * @method static QueryBuilder|User[] wherePassword($value) diff --git a/src/Models/User/UsesUserModel.php b/src/Models/User/UsesUserModel.php index e0185b10..ff33e968 100644 --- a/src/Models/User/UsesUserModel.php +++ b/src/Models/User/UsesUserModel.php @@ -10,7 +10,7 @@ use Illuminate\Database\Query\Builder as QueryBuilder; * * @property-read QueryBuilder|User $user * - * @method static QueryBuilder|static whereUserId($value) + * @method static QueryBuilder|static[] whereUserId($value) */ trait UsesUserModel {