From 1504ff3ec8edac1c335e269426ba5cbb925c86ac Mon Sep 17 00:00:00 2001 From: Mohamed Alsharaf Date: Tue, 28 Apr 2015 13:13:44 +1200 Subject: [PATCH] Misc: update magic methods docs --- app/Model/Traits/Project/FilterTrait.php | 2 +- .../Project/Issue/Attachment/CrudTrait.php | 24 +++++------ .../Issue/Attachment/RelationTrait.php | 13 +++--- .../Project/Issue/Comment/CrudTrait.php | 27 ++++++------ .../Project/Issue/Comment/RelationTrait.php | 15 ++++--- app/Model/Traits/Project/Issue/CountTrait.php | 8 ++-- app/Model/Traits/Project/Issue/CrudTrait.php | 41 ++++++++++--------- app/Model/Traits/Project/Issue/QueryTrait.php | 3 +- .../Traits/Project/Issue/RelationTrait.php | 27 ++++++------ app/Model/Traits/Project/Note/CrudTrait.php | 17 ++++---- .../Traits/Project/Note/RelationTrait.php | 12 +++--- app/Model/Traits/Project/QueryTrait.php | 21 +++++----- app/Model/Traits/Project/RelationTrait.php | 20 ++++----- app/Model/Traits/Project/SortTrait.php | 4 +- .../Traits/Project/User/RelationTrait.php | 8 ++-- .../Traits/Role/Permission/RelationTrait.php | 6 +-- app/Model/Traits/Role/QueryTrait.php | 2 +- app/Model/Traits/Role/RelationTrait.php | 13 +++--- app/Model/Traits/Tag/CountTrait.php | 4 +- app/Model/Traits/Tag/CrudTrait.php | 4 +- app/Model/Traits/Tag/QueryTrait.php | 7 ++-- app/Model/Traits/Tag/RelationTrait.php | 14 +++---- .../Traits/User/Activity/RelationTrait.php | 21 ++++------ app/Model/Traits/User/CountTrait.php | 7 ++-- app/Model/Traits/User/CrudTrait.php | 5 +-- app/Model/Traits/User/QueryTrait.php | 4 +- app/Model/Traits/User/RelationTrait.php | 27 ++++++------ 27 files changed, 175 insertions(+), 181 deletions(-) diff --git a/app/Model/Traits/Project/FilterTrait.php b/app/Model/Traits/Project/FilterTrait.php index 0eee0f925..7d45a8f1d 100644 --- a/app/Model/Traits/Project/FilterTrait.php +++ b/app/Model/Traits/Project/FilterTrait.php @@ -21,7 +21,7 @@ * * @author Mohamed Alsharaf * - * @property int $id + * @property int $id * * @method Query\Builder where($column, $operator = null, $value = null, $boolean = 'and') * @method Query\Builder join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false) diff --git a/app/Model/Traits/Project/Issue/Attachment/CrudTrait.php b/app/Model/Traits/Project/Issue/Attachment/CrudTrait.php index 4b81cc458..ce5707943 100644 --- a/app/Model/Traits/Project/Issue/Attachment/CrudTrait.php +++ b/app/Model/Traits/Project/Issue/Attachment/CrudTrait.php @@ -22,19 +22,19 @@ * * @author Mohamed Alsharaf * - * @property int $id - * @property int $uploaded_by - * @property int $issue_id - * @property int $comment_id - * @property string $filename - * @property string $fileextension - * @property int $filesize - * @property string $upload_token - * @property Project\Issue $issue + * @property int $id + * @property int $uploaded_by + * @property int $issue_id + * @property int $comment_id + * @property string $filename + * @property string $fileextension + * @property int $filesize + * @property string $upload_token + * @property Project\Issue $issue * - * @method Eloquent\Model save() - * @method Eloquent\Model delete() - * @method Eloquent\Model where() + * @method Eloquent\Model save() + * @method Eloquent\Model delete() + * @method Eloquent\Model where() */ trait CrudTrait { diff --git a/app/Model/Traits/Project/Issue/Attachment/RelationTrait.php b/app/Model/Traits/Project/Issue/Attachment/RelationTrait.php index 59a398b54..5e7bed6ce 100644 --- a/app/Model/Traits/Project/Issue/Attachment/RelationTrait.php +++ b/app/Model/Traits/Project/Issue/Attachment/RelationTrait.php @@ -11,24 +11,21 @@ namespace Tinyissue\Model\Traits\Project\Issue\Attachment; -use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; /** * RelationTrait is trait class containing the relationship methods for the Project\Issue\Attachment model * * @author Mohamed Alsharaf * - * @method Eloquent\Model hasMany($related, $foreignKey = null, $localKey = null) - * @method Eloquent\Model hasOne($related, $foreignKey = null, $localKey = null) - * @method Eloquent\Model belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null) - * @method Eloquent\Model belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) + * @method Relations\BelongsTo belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) */ trait RelationTrait { /** * An attachment is belong to one issue (inverse relationship of Project\Issue::attachments) * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function issue() { @@ -38,7 +35,7 @@ public function issue() /** * An attachment has one user upladed to (inverse relationship of User::attachments). * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function user() { @@ -48,7 +45,7 @@ public function user() /** * An attachment can belong to a comment (inverse relationship of Comments::attachments). * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function comment() { diff --git a/app/Model/Traits/Project/Issue/Comment/CrudTrait.php b/app/Model/Traits/Project/Issue/Comment/CrudTrait.php index 1fa1638ed..97a9b864c 100644 --- a/app/Model/Traits/Project/Issue/Comment/CrudTrait.php +++ b/app/Model/Traits/Project/Issue/Comment/CrudTrait.php @@ -12,6 +12,7 @@ namespace Tinyissue\Model\Traits\Project\Issue\Comment; use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; use Tinyissue\Model; use Tinyissue\Model\Activity; use Tinyissue\Model\User; @@ -25,20 +26,20 @@ * * @author Mohamed Alsharaf * - * @property int $id - * @property int $issue_id - * @property int $project_id - * @property string $comment - * @property int $created_by - * @property User $user - * @property Project $project - * @property Issue $issue - * @property Collection $attachments + * @property int $id + * @property int $issue_id + * @property int $project_id + * @property string $comment + * @property int $created_by + * @property User $user + * @property Project $project + * @property Issue $issue + * @property Collection $attachments * - * @method Eloquent\Model save() - * @method Eloquent\Model fill(array $attributes) - * @method Eloquent\Model activity() - * @method Eloquent\Model delete() + * @method Eloquent\Model save() + * @method Eloquent\Model fill(array $attributes) + * @method Relations\HasOne activity() + * @method Eloquent\Model delete() */ trait CrudTrait { diff --git a/app/Model/Traits/Project/Issue/Comment/RelationTrait.php b/app/Model/Traits/Project/Issue/Comment/RelationTrait.php index 5d4284d89..780df73d8 100644 --- a/app/Model/Traits/Project/Issue/Comment/RelationTrait.php +++ b/app/Model/Traits/Project/Issue/Comment/RelationTrait.php @@ -11,24 +11,23 @@ namespace Tinyissue\Model\Traits\Project\Issue\Comment; -use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; /** * RelationTrait is trait class containing the relationship methods for the Project\Issue\Comment model * * @author Mohamed Alsharaf * - * @method Eloquent\Model hasMany($related, $foreignKey = null, $localKey = null) - * @method Eloquent\Model hasOne($related, $foreignKey = null, $localKey = null) - * @method Eloquent\Model belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null) - * @method Eloquent\Model belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) + * @method Relations\HasMany hasMany($related, $foreignKey = null, $localKey = null) + * @method Relations\BelongsTo belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) + * @method Relations\HasOne hasOne($related, $foreignKey = null, $localKey = null) */ trait RelationTrait { /** * A comment has one user (inverse relationship of User::comments). * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function user() { @@ -38,7 +37,7 @@ public function user() /** * Comment can have many attachments * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function attachments() { @@ -48,7 +47,7 @@ public function attachments() /** * Comment can have one activity * - * @return Eloquent\Relations\HasOne + * @return Relations\HasOne */ public function activity() { diff --git a/app/Model/Traits/Project/Issue/CountTrait.php b/app/Model/Traits/Project/Issue/CountTrait.php index 2895c2ad7..0f43521fd 100644 --- a/app/Model/Traits/Project/Issue/CountTrait.php +++ b/app/Model/Traits/Project/Issue/CountTrait.php @@ -11,7 +11,7 @@ namespace Tinyissue\Model\Traits\Project\Issue; -use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; use Tinyissue\Model; /** @@ -25,16 +25,14 @@ * @property Model\Project $project * @property Model\User $createdBy * - * @method Eloquent\Model belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) - * @method Eloquent\Model save() - * @method Model\Project\Note activity() + * @method Relations\HasOne hasOne($related, $foreignKey = null, $localKey = null) */ trait CountTrait { /** * Count number of comments in an issue * - * @return \Illuminate\Database\Eloquent\Relations\HasOne + * @return Relations\HasOne */ public function countComments() { diff --git a/app/Model/Traits/Project/Issue/CrudTrait.php b/app/Model/Traits/Project/Issue/CrudTrait.php index 2a3ee705d..ee1340012 100644 --- a/app/Model/Traits/Project/Issue/CrudTrait.php +++ b/app/Model/Traits/Project/Issue/CrudTrait.php @@ -12,6 +12,7 @@ namespace Tinyissue\Model\Traits\Project\Issue; use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; use Tinyissue\Model; use Tinyissue\Model\Activity; use Tinyissue\Model\Project; @@ -23,27 +24,27 @@ * * @author Mohamed Alsharaf * - * @property int $id - * @property int $created_by - * @property int $project_id - * @property string $title - * @property string $body - * @property int $assigned_to - * @property int $time_quote - * @property int $closed_by - * @property int $closed_at - * @property int status - * @property int $updated_at - * @property int $updated_by - * @property Project $project - * @property User $user - * @property User $updatedBy + * @property int $id + * @property int $created_by + * @property int $project_id + * @property string $title + * @property string $body + * @property int $assigned_to + * @property int $time_quote + * @property int $closed_by + * @property int $closed_at + * @property int status + * @property int $updated_at + * @property int $updated_by + * @property Project $project + * @property User $user + * @property User $updatedBy * - * @method Eloquent\Model save() - * @method Eloquent\Model fill(array $attributes) - * @method Project\Issue tags() - * @method Project\Issue activities() - * @method Project\Issue comments() + * @method Eloquent\Model save() + * @method Eloquent\Model fill(array $attributes) + * @method Relations\BelongsToMany tags() + * @method Relations\HasMany activities() + * @method Relations\HasMany comments() */ trait CrudTrait { diff --git a/app/Model/Traits/Project/Issue/QueryTrait.php b/app/Model/Traits/Project/Issue/QueryTrait.php index dc02d7da8..21c4ed8d2 100644 --- a/app/Model/Traits/Project/Issue/QueryTrait.php +++ b/app/Model/Traits/Project/Issue/QueryTrait.php @@ -12,6 +12,7 @@ namespace Tinyissue\Model\Traits\Project\Issue; use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; use Tinyissue\Model\Tag; /** @@ -19,7 +20,7 @@ * * @author Mohamed Alsharaf * - * @method Eloquent\Collection tags() + * @method Relations\BelongsToMany tags() */ trait QueryTrait { diff --git a/app/Model/Traits/Project/Issue/RelationTrait.php b/app/Model/Traits/Project/Issue/RelationTrait.php index b15d8f950..eef883faa 100644 --- a/app/Model/Traits/Project/Issue/RelationTrait.php +++ b/app/Model/Traits/Project/Issue/RelationTrait.php @@ -11,7 +11,7 @@ namespace Tinyissue\Model\Traits\Project\Issue; -use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; use Tinyissue\Model; /** @@ -19,17 +19,16 @@ * * @author Mohamed Alsharaf * - * @method Eloquent\Model hasMany($related, $foreignKey = null, $localKey = null) - * @method Eloquent\Model hasOne($related, $foreignKey = null, $localKey = null) - * @method Eloquent\Model belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null) - * @method Eloquent\Model belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) + * @method Relations\HasMany hasMany($related, $foreignKey = null, $localKey = null) + * @method Relations\BelongsToMany belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null) + * @method Relations\BelongsTo belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) */ trait RelationTrait { /** * An issue has one user assigned to (inverse relationship of User::issues). * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function assigned() { @@ -39,7 +38,7 @@ public function assigned() /** * An issue has one user updated by (inverse relationship of User::issuesUpdatedBy). * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function updatedBy() { @@ -49,7 +48,7 @@ public function updatedBy() /** * An issue has one user closed it (inverse relationship of User::issuesClosedBy). * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function closer() { @@ -59,7 +58,7 @@ public function closer() /** * An issue has one user created it (inverse relationship of User::issuesCreatedBy). * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function user() { @@ -69,7 +68,7 @@ public function user() /** * Issue belong to a project * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function project() { @@ -79,7 +78,7 @@ public function project() /** * Issue can have many attachments * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function attachments() { @@ -92,7 +91,7 @@ public function attachments() /** * Issue have many users activities * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function activities() { @@ -104,7 +103,7 @@ public function activities() /** * Issue have many tags * - * @return Eloquent\Relations\BelongsToMany + * @return Relations\BelongsToMany */ public function tags() { @@ -114,7 +113,7 @@ public function tags() /** * Issue have many comments * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function comments() { diff --git a/app/Model/Traits/Project/Note/CrudTrait.php b/app/Model/Traits/Project/Note/CrudTrait.php index 1d0bceca9..0be6e3c22 100644 --- a/app/Model/Traits/Project/Note/CrudTrait.php +++ b/app/Model/Traits/Project/Note/CrudTrait.php @@ -12,6 +12,7 @@ namespace Tinyissue\Model\Traits\Project\Note; use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; use Tinyissue\Model; /** @@ -19,15 +20,15 @@ * * @author Mohamed Alsharaf * - * @property int $project_id - * @property int $created_by - * @property string $body - * @property Model\Project $project - * @property Model\User $createdBy + * @property int $project_id + * @property int $created_by + * @property string $body + * @property Model\Project $project + * @property Model\User $createdBy * - * @method Eloquent\Model belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) - * @method Eloquent\Model save() - * @method Model\Project\Note activity() + * @method Relations\BelongsTo belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) + * @method Eloquent\Model save() + * @method Relations\HasOne activity() */ trait CrudTrait { diff --git a/app/Model/Traits/Project/Note/RelationTrait.php b/app/Model/Traits/Project/Note/RelationTrait.php index 7692a3ae8..a9ff69273 100644 --- a/app/Model/Traits/Project/Note/RelationTrait.php +++ b/app/Model/Traits/Project/Note/RelationTrait.php @@ -11,7 +11,7 @@ namespace Tinyissue\Model\Traits\Project\Note; -use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; use Tinyissue\Model; /** @@ -19,15 +19,15 @@ * * @author Mohamed Alsharaf * - * @method Eloquent\Model hasOne($related, $foreignKey = null, $localKey = null) - * @method Eloquent\Model belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) + * @method Relations\BelongsTo belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) + * @method Relations\HasOne hasOne($related, $foreignKey = null, $localKey = null) */ trait RelationTrait { /** * Note created by a user * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function createdBy() { @@ -37,7 +37,7 @@ public function createdBy() /** * Note belong to a project * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function project() { @@ -47,7 +47,7 @@ public function project() /** * Note has a user activity record * - * @return Eloquent\Relations\HasOne + * @return Relations\HasOne */ public function activity() { diff --git a/app/Model/Traits/Project/QueryTrait.php b/app/Model/Traits/Project/QueryTrait.php index eb58b0d87..e8656a09b 100644 --- a/app/Model/Traits/Project/QueryTrait.php +++ b/app/Model/Traits/Project/QueryTrait.php @@ -12,6 +12,7 @@ namespace Tinyissue\Model\Traits\Project; use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Database\Query; use Tinyissue\Model\Project; @@ -23,17 +24,17 @@ * * @author Mohamed Alsharaf * - * @property int $id + * @property int $id * - * @method Query\Builder where($column, $operator = null, $value = null, $boolean = 'and') - * @method Query\Builder join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false) - * @method RelationTrait users() - * @method RelationTrait issues() - * @method FilterTrait filterAssignTo(Query\Builder $query, $userId) - * @method FilterTrait filterTitleOrBody(Query\Builder $query, $keyword) - * @method FilterTrait filterTags(Eloquent\Builder $query, array $tags) - * @method SortTrait sortByUpdated(Query\Builder $query, $order = 'asc') - * @method SortTrait sortByTag(Query\Builder $query, $tagGroup, $order = 'asc') + * @method Eloquent\Model where($column, $operator = null, $value = null, $boolean = 'and') + * @method Query\Builder join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false) + * @method Relations\HasMany users() + * @method Relations\HasMany issues() + * @method void filterAssignTo(Query\Builder $query, $userId) + * @method void filterTitleOrBody(Query\Builder $query, $keyword) + * @method void filterTags(Eloquent\Builder $query, array $tags) + * @method void sortByUpdated(Query\Builder $query, $order = 'asc') + * @method Eloquent\Collection sortByTag(Query\Builder $query, $tagGroup, $order = 'asc') */ trait QueryTrait { diff --git a/app/Model/Traits/Project/RelationTrait.php b/app/Model/Traits/Project/RelationTrait.php index f846f8681..08123f094 100644 --- a/app/Model/Traits/Project/RelationTrait.php +++ b/app/Model/Traits/Project/RelationTrait.php @@ -11,7 +11,7 @@ namespace Tinyissue\Model\Traits\Project; -use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; use Tinyissue\Model\Project; /** @@ -19,15 +19,15 @@ * * @author Mohamed Alsharaf * - * @method Eloquent\Model hasMany($related, $foreignKey = null, $localKey = null) - * @method Eloquent\Model belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null) + * @method Relations\HasMany hasMany($related, $foreignKey = null, $localKey = null) + * @method Relations\BelongsToMany belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null) */ trait RelationTrait { /** * Returns all issues related to project. * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function issues() { @@ -37,7 +37,7 @@ public function issues() /** * Returns issues in the project with user details eager loaded * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function issuesByUser() { @@ -47,7 +47,7 @@ public function issuesByUser() /** * Returns all users assigned in the current project. * - * @return Eloquent\Relations\BelongsToMany + * @return Relations\BelongsToMany */ public function users() { @@ -59,7 +59,7 @@ public function users() * * @param int $userId * - * @return Eloquent\Relations\BelongsToMany + * @return Relations\BelongsToMany */ public function user($userId) { @@ -69,7 +69,7 @@ public function user($userId) /** * Project has many project users * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function projectUsers() { @@ -79,7 +79,7 @@ public function projectUsers() /** * Returns project activities * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function activities() { @@ -89,7 +89,7 @@ public function activities() /** * Returns notes in the project * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function notes() { diff --git a/app/Model/Traits/Project/SortTrait.php b/app/Model/Traits/Project/SortTrait.php index 840b843d1..e559a0fb5 100644 --- a/app/Model/Traits/Project/SortTrait.php +++ b/app/Model/Traits/Project/SortTrait.php @@ -20,9 +20,9 @@ * * @author Mohamed Alsharaf * - * @property int $id + * @property int $id * - * @method Query\Builder where($column, $operator = null, $value = null, $boolean = 'and') + * @method Eloquent\Model where($column, $operator = null, $value = null, $boolean = 'and') */ trait SortTrait { diff --git a/app/Model/Traits/Project/User/RelationTrait.php b/app/Model/Traits/Project/User/RelationTrait.php index 87349f35e..45561ccf1 100644 --- a/app/Model/Traits/Project/User/RelationTrait.php +++ b/app/Model/Traits/Project/User/RelationTrait.php @@ -11,21 +11,21 @@ namespace Tinyissue\Model\Traits\Project\User; -use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; /** * RelationTrait is trait class containing the relationship methods for the Project\User model * * @author Mohamed Alsharaf * - * @method Eloquent\Model belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) + * @method Relations\BelongsTo belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) */ trait RelationTrait { /** * Returns the instance of the user in the project * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function user() { @@ -35,7 +35,7 @@ public function user() /** * Returns the instance of the project * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function project() { diff --git a/app/Model/Traits/Role/Permission/RelationTrait.php b/app/Model/Traits/Role/Permission/RelationTrait.php index b5ab22b80..594db22dc 100644 --- a/app/Model/Traits/Role/Permission/RelationTrait.php +++ b/app/Model/Traits/Role/Permission/RelationTrait.php @@ -11,21 +11,21 @@ namespace Tinyissue\Model\Traits\Role\Permission; -use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; /** * RelationTrait is trait class containing the relationship method for the Role\Permission model * * @author Mohamed Alsharaf * - * @method Eloquent\Model hasOne($related, $foreignKey = null, $localKey = null) + * @method Relations\HasOne hasOne($related, $foreignKey = null, $localKey = null) */ trait RelationTrait { /** * Returns the permission for a role * - * @return Eloquent\Relations\HasOne + * @return Relations\HasOne */ public function permission() { diff --git a/app/Model/Traits/Role/QueryTrait.php b/app/Model/Traits/Role/QueryTrait.php index dbaadbc64..d7181487e 100644 --- a/app/Model/Traits/Role/QueryTrait.php +++ b/app/Model/Traits/Role/QueryTrait.php @@ -19,7 +19,7 @@ * * @author Mohamed Alsharaf * - * @method Eloquent\Model with($relations) + * @method Eloquent\Builder with($relations) */ trait QueryTrait { diff --git a/app/Model/Traits/Role/RelationTrait.php b/app/Model/Traits/Role/RelationTrait.php index 44be505a7..f1986d2ee 100644 --- a/app/Model/Traits/Role/RelationTrait.php +++ b/app/Model/Traits/Role/RelationTrait.php @@ -11,7 +11,7 @@ namespace Tinyissue\Model\Traits\Role; -use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; use Tinyissue\Model\User; /** @@ -19,16 +19,15 @@ * * @author Mohamed Alsharaf * - * @method Eloquent\Model hasMany($related, $foreignKey = null, $localKey = null) - * @method Eloquent\Model belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null) - * @method Eloquent\Model belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) + * @method Relations\HasMany hasMany($related, $foreignKey = null, $localKey = null) + * @method Relations\BelongsToMany belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null) */ trait RelationTrait { /** * Role has many users (One-many relationship of User::role). * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function users() { @@ -41,7 +40,7 @@ public function users() /** * Role has many users in a project_users. * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function projectUsers() { @@ -51,7 +50,7 @@ public function projectUsers() /** * Role has many role permission. * - * @return Eloquent\Relations\BelongsToMany + * @return Relations\BelongsToMany */ public function permissions() { diff --git a/app/Model/Traits/Tag/CountTrait.php b/app/Model/Traits/Tag/CountTrait.php index 05fe6d567..31b7b4d47 100644 --- a/app/Model/Traits/Tag/CountTrait.php +++ b/app/Model/Traits/Tag/CountTrait.php @@ -11,14 +11,14 @@ namespace Tinyissue\Model\Traits\Tag; -use Illuminate\Database\Query; +use Illuminate\Database\Eloquent; /** * CountTrait is trait class containing the methods for counting database records for the Tag model * * @author Mohamed Alsharaf * - * @method Query\Builder where($column, $operator = null, $value = null, $boolean = 'and') + * @method Eloquent\Model where($column, $operator = null, $value = null, $boolean = 'and') */ trait CountTrait { diff --git a/app/Model/Traits/Tag/CrudTrait.php b/app/Model/Traits/Tag/CrudTrait.php index e3e3488aa..f27eaa428 100644 --- a/app/Model/Traits/Tag/CrudTrait.php +++ b/app/Model/Traits/Tag/CrudTrait.php @@ -11,7 +11,7 @@ namespace Tinyissue\Model\Traits\Tag; -use Illuminate\Database\Query; +use Illuminate\Database\Eloquent; use Tinyissue\Model\Tag; /** @@ -19,7 +19,7 @@ * * @author Mohamed Alsharaf * - * @method Query\Builder where($column, $operator = null, $value = null, $boolean = 'and') + * @method Eloquent\Model where($column, $operator = null, $value = null, $boolean = 'and') */ trait CrudTrait { diff --git a/app/Model/Traits/Tag/QueryTrait.php b/app/Model/Traits/Tag/QueryTrait.php index 3aa6f206b..d7eae3c1c 100644 --- a/app/Model/Traits/Tag/QueryTrait.php +++ b/app/Model/Traits/Tag/QueryTrait.php @@ -12,15 +12,16 @@ namespace Tinyissue\Model\Traits\Tag; use Illuminate\Database\Eloquent; -use Tinyissue\Model\Tag; +use Illuminate\Database\Query; /** * QueryTrait is trait class containing the database queries methods for the Tag model * * @author Mohamed Alsharaf * - * @method Eloquent\Model with($relations) - * @method Eloquent\Model where() + * @method Eloquent\Builder with($relations) + * @method Eloquent\Model where($column, $operator = null, $value = null, $boolean = 'and') + * @method Query\Builder whereIn($column, $values, $boolean = 'and', $not = false) */ trait QueryTrait { diff --git a/app/Model/Traits/Tag/RelationTrait.php b/app/Model/Traits/Tag/RelationTrait.php index d9bd92ff6..2a906dc49 100644 --- a/app/Model/Traits/Tag/RelationTrait.php +++ b/app/Model/Traits/Tag/RelationTrait.php @@ -11,23 +11,23 @@ namespace Tinyissue\Model\Traits\Tag; -use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; /** * RelationTrait is trait class containing the relationship methods for the Tag model * * @author Mohamed Alsharaf * - * @method Eloquent\Model hasMany($related, $foreignKey = null, $localKey = null) - * @method Eloquent\Model belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null) - * @method Eloquent\Model belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) + * @method Relations\HasMany hasMany($related, $foreignKey = null, $localKey = null) + * @method Relations\BelongsToMany belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null) + * @method Relations\BelongsTo belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) */ trait RelationTrait { /** * Returns the parent/group for the tag * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function parent() { @@ -37,7 +37,7 @@ public function parent() /** * Parent tag/group have many tags * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function tags() { @@ -47,7 +47,7 @@ public function tags() /** * Returns issues for the Tag. Tag can belong to many issues & issue can have many tags * - * @return Eloquent\Relations\BelongsToMany + * @return Relations\BelongsToMany */ public function issues() { diff --git a/app/Model/Traits/User/Activity/RelationTrait.php b/app/Model/Traits/User/Activity/RelationTrait.php index cee809ee5..8c11f4076 100644 --- a/app/Model/Traits/User/Activity/RelationTrait.php +++ b/app/Model/Traits/User/Activity/RelationTrait.php @@ -11,7 +11,7 @@ namespace Tinyissue\Model\Traits\User\Activity; -use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; use Tinyissue\Model\Project; /** @@ -19,17 +19,14 @@ * * @author Mohamed Alsharaf * - * @method Eloquent\Model hasMany($related, $foreignKey = null, $localKey = null) - * @method Eloquent\Model belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null) - * @method Eloquent\Model belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) - * @method Eloquent\Model hasOne($related, $foreignKey = null, $localKey = null) + * @method Relations\BelongsTo belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) */ trait RelationTrait { /** * Returns the project issue this activity is belongs to by the item_id, which can hold the issue id * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function issue() { @@ -39,7 +36,7 @@ public function issue() /** * Returns the user this activity is belongs to * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function user() { @@ -49,7 +46,7 @@ public function user() /** * Returns the user that was assigned to the issue. Only for reassign activity * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function assignTo() { @@ -59,7 +56,7 @@ public function assignTo() /** * User activity has one activity type * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function activity() { @@ -69,7 +66,7 @@ public function activity() /** * Returns the comment this activity belongs to if any * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function comment() { @@ -79,7 +76,7 @@ public function comment() /** * Returns the project his activity belongs to * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function project() { @@ -89,7 +86,7 @@ public function project() /** * Returns the note this activity belongs to if any * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function note() { diff --git a/app/Model/Traits/User/CountTrait.php b/app/Model/Traits/User/CountTrait.php index 5661df6a2..4a245d231 100644 --- a/app/Model/Traits/User/CountTrait.php +++ b/app/Model/Traits/User/CountTrait.php @@ -11,6 +11,7 @@ namespace Tinyissue\Model\Traits\User; +use Illuminate\Database\Eloquent\Relations; use Tinyissue\Model\Project; use Tinyissue\Model\User; @@ -19,9 +20,9 @@ * * @author Mohamed Alsharaf * - * @method User permission($key) - * @method RelationTrait projects($status = Project::STATUS_OPEN) - * @method RelationTrait issues() + * @method bool permission($key) + * @method Relations\HasMany projects($status = Project::STATUS_OPEN) + * @method Relations\HasMany issues() */ trait CountTrait { diff --git a/app/Model/Traits/User/CrudTrait.php b/app/Model/Traits/User/CrudTrait.php index 43c29a501..53b616ca7 100644 --- a/app/Model/Traits/User/CrudTrait.php +++ b/app/Model/Traits/User/CrudTrait.php @@ -13,7 +13,6 @@ use Hash; use Illuminate\Database\Eloquent; -use Illuminate\Database\Query; use Illuminate\Mail\Message as MailMessage; use Illuminate\Support\Str; use Mail; @@ -29,8 +28,8 @@ * @property string $email * @property string $fullname * - * @method Query\Builder where($column, $operator = null, $value = null, $boolean = 'and') - * @method Project fill(array $attributes) + * @method Eloquent\Model where($column, $operator = null, $value = null, $boolean = 'and') + * @method Eloquent\Model fill(array $attributes) * @method Eloquent\Model update(array $attributes = array()) */ trait CrudTrait diff --git a/app/Model/Traits/User/QueryTrait.php b/app/Model/Traits/User/QueryTrait.php index 401341dcf..cb9c88059 100644 --- a/app/Model/Traits/User/QueryTrait.php +++ b/app/Model/Traits/User/QueryTrait.php @@ -23,8 +23,8 @@ * @property int $id * @property Eloquent\Collection $permission * - * @method RelationTrait projects($status = Project::STATUS_OPEN) - * @method RelationTrait permissions() + * @method Relations\HasMany projects($status = Project::STATUS_OPEN) + * @method Relations\HasMany permissions() */ trait QueryTrait { diff --git a/app/Model/Traits/User/RelationTrait.php b/app/Model/Traits/User/RelationTrait.php index ba0e00c9a..a99d50a6d 100644 --- a/app/Model/Traits/User/RelationTrait.php +++ b/app/Model/Traits/User/RelationTrait.php @@ -11,7 +11,7 @@ namespace Tinyissue\Model\Traits\User; -use Illuminate\Database\Eloquent; +use Illuminate\Database\Eloquent\Relations; use Tinyissue\Model\Project; /** @@ -19,17 +19,16 @@ * * @author Mohamed Alsharaf * - * @method Eloquent\Model hasMany($related, $foreignKey = null, $localKey = null) - * @method Eloquent\Model belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null) - * @method Eloquent\Model belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) - * @method Eloquent\Model hasOne($related, $foreignKey = null, $localKey = null) + * @method Relations\HasMany hasMany($related, $foreignKey = null, $localKey = null) + * @method Relations\BelongsToMany belongsToMany($related, $table = null, $foreignKey = null, $otherKey = null, $relation = null) + * @method Relations\BelongsTo belongsTo($related, $foreignKey = null, $otherKey = null, $relation = null) */ trait RelationTrait { /** * A user has one role (inverse relationship of Role::users). * - * @return Eloquent\Relations\BelongsTo + * @return Relations\BelongsTo */ public function role() { @@ -39,7 +38,7 @@ public function role() /** * User has many comments (One-many relationship of Comment::user). * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function comments() { @@ -49,7 +48,7 @@ public function comments() /** * Returns issues created by the user * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function issuesCreatedBy() { @@ -59,7 +58,7 @@ public function issuesCreatedBy() /** * Returns issues closed by the user * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function issuesClosedBy() { @@ -69,7 +68,7 @@ public function issuesClosedBy() /** * Returns issues updated by the user * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function issuesUpdatedBy() { @@ -79,7 +78,7 @@ public function issuesUpdatedBy() /** * User has many attachments (One-many relationship of Attachment::user). * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function attachments() { @@ -91,7 +90,7 @@ public function attachments() * * @param int $status * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function projects($status = Project::STATUS_OPEN) { @@ -104,7 +103,7 @@ public function projects($status = Project::STATUS_OPEN) /** * User has many issues assigned to (One-many relationship of Issue::assigned). * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function issues() { @@ -114,7 +113,7 @@ public function issues() /** * Returns all permission for the user * - * @return Eloquent\Relations\HasMany + * @return Relations\HasMany */ public function permissions() {