|
4 | 4 |
|
5 | 5 | namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Models;
|
6 | 6 |
|
| 7 | +use Illuminate\Database\Eloquent\Model; |
| 8 | +use Illuminate\Database\Eloquent\Relations\BelongsTo; |
| 9 | + |
| 10 | +/** |
| 11 | + * Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Models\BelongsToVariation |
| 12 | + * |
| 13 | + * @property integer $id |
| 14 | + * @property integer $not_null_column_with_foreign_key_constraint |
| 15 | + * @property integer $not_null_column_with_no_foreign_key_constraint |
| 16 | + * @property integer|null $nullable_column_with_foreign_key_constraint |
| 17 | + * @property integer|null $nullable_column_with_no_foreign_key_constraint |
| 18 | + * @property-read BelongsToVariation $notNullColumnWithForeignKeyConstraint |
| 19 | + * @property-read BelongsToVariation|null $notNullColumnWithNoForeignKeyConstraint |
| 20 | + * @property-read BelongsToVariation|null $nullableColumnWithForeignKeyConstraint |
| 21 | + * @property-read BelongsToVariation|null $nullableColumnWithNoForeignKeyConstraint |
| 22 | + * @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation newModelQuery() |
| 23 | + * @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation newQuery() |
| 24 | + * @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation query() |
| 25 | + * @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation whereId($value) |
| 26 | + * @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation whereNotNullColumnWithForeignKeyConstraint($value) |
| 27 | + * @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation whereNotNullColumnWithNoForeignKeyConstraint($value) |
| 28 | + * @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation whereNullableColumnWithForeignKeyConstraint($value) |
| 29 | + * @method static \Illuminate\Database\Eloquent\Builder|BelongsToVariation whereNullableColumnWithNoForeignKeyConstraint($value) |
| 30 | + * @mixin \Eloquent |
| 31 | + */ |
| 32 | +class BelongsToVariation extends Model |
| 33 | +{ |
| 34 | + public function notNullColumnWithForeignKeyConstraint(): BelongsTo |
| 35 | + { |
| 36 | + return $this->belongsTo(self::class, 'not_null_column_with_foreign_key_constraint'); |
| 37 | + } |
| 38 | + |
| 39 | + public function notNullColumnWithNoForeignKeyConstraint(): BelongsTo |
| 40 | + { |
| 41 | + return $this->belongsTo(self::class, 'not_null_column_with_no_foreign_key_constraint'); |
| 42 | + } |
| 43 | + |
| 44 | + public function nullableColumnWithForeignKeyConstraint(): BelongsTo |
| 45 | + { |
| 46 | + return $this->belongsTo(self::class, 'nullable_column_with_foreign_key_constraint'); |
| 47 | + } |
| 48 | + |
| 49 | + public function nullableColumnWithNoForeignKeyConstraint(): BelongsTo |
| 50 | + { |
| 51 | + return $this->belongsTo(self::class, 'nullable_column_with_no_foreign_key_constraint'); |
| 52 | + } |
| 53 | +} |
| 54 | +<?php |
| 55 | + |
| 56 | +declare(strict_types=1); |
| 57 | + |
| 58 | +namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Models; |
| 59 | + |
7 | 60 | use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\ModelsOtherNamespace\AnotherModel;
|
8 | 61 | use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Traits\HasTestRelations;
|
9 | 62 | use Illuminate\Database\Eloquent\Model;
|
|
20 | 73 | * Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Models\Simple
|
21 | 74 | *
|
22 | 75 | * @property integer $id
|
23 |
| - * @property-read Simple $relationBelongsTo |
24 |
| - * @property-read AnotherModel $relationBelongsToInAnotherNamespace |
| 76 | + * @property-read Simple|null $relationBelongsTo |
| 77 | + * @property-read AnotherModel|null $relationBelongsToInAnotherNamespace |
25 | 78 | * @property-read \Illuminate\Database\Eloquent\Collection|Simple[] $relationBelongsToMany
|
26 | 79 | * @property-read int|null $relation_belongs_to_many_count
|
27 | 80 | * @property-read \Illuminate\Database\Eloquent\Collection|Simple[] $relationBelongsToManyWithSub
|
28 | 81 | * @property-read int|null $relation_belongs_to_many_with_sub_count
|
29 | 82 | * @property-read \Illuminate\Database\Eloquent\Collection|Simple[] $relationBelongsToManyWithSubAnother
|
30 | 83 | * @property-read int|null $relation_belongs_to_many_with_sub_another_count
|
31 |
| - * @property-read AnotherModel $relationBelongsToSameNameAsColumn |
| 84 | + * @property-read AnotherModel|null $relationBelongsToSameNameAsColumn |
32 | 85 | * @property-read \Illuminate\Database\Eloquent\Collection|Simple[] $relationHasMany
|
33 | 86 | * @property-read int|null $relation_has_many_count
|
34 | 87 | * @property-read Simple|null $relationHasOne
|
|
0 commit comments