1: | <?php |
2: | /** |
3: | * This code is licensed under AGPLv3 license or Afterlogic Software License |
4: | * if commercial version of the product was purchased. |
5: | * For full statements of the licenses see LICENSE-AFTERLOGIC and LICENSE-AGPL3 files. |
6: | */ |
7: | |
8: | namespace Aurora\Modules\Core\Models; |
9: | |
10: | use Aurora\System\Classes\Model; |
11: | |
12: | /** |
13: | * The Core UserBlock class. |
14: | * |
15: | * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0 |
16: | * @license https://afterlogic.com/products/common-licensing Afterlogic Software License |
17: | * @copyright Copyright (c) 2023, Afterlogic Corp. |
18: | * @property int $Id Object primary key |
19: | * @property int $UserId User ID of the user blocked |
20: | * @property string $Email Public ID of the user blocked |
21: | * @property string $IpAddress IP address recorded for the user block |
22: | * @property int $ErrorLoginsCount Number of failed login attempts |
23: | * @property int $Time Timestamp when user block added |
24: | * @property array $Properties Custom properties for use by other modules |
25: | * @property \Illuminate\Support\Carbon|null $CreatedAt |
26: | * @property \Illuminate\Support\Carbon|null $UpdatedAt |
27: | * @property-read mixed $entity_id |
28: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Core\Models\UserBlock firstWhere(Closure|string|array|\Illuminate\Database\Query\Expression $column, mixed $operator = null, mixed $value = null, string $boolean = 'and') |
29: | * @method static \Illuminate\Database\Eloquent\Builder|UserBlock newModelQuery() |
30: | * @method static \Illuminate\Database\Eloquent\Builder|UserBlock newQuery() |
31: | * @method static \Illuminate\Database\Eloquent\Builder|UserBlock query() |
32: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Core\Models\UserBlock where(Closure|string|array|\Illuminate\Database\Query\Expression $column, mixed $operator = null, mixed $value = null, string $boolean = 'and') |
33: | * @method static \Illuminate\Database\Eloquent\Builder|UserBlock whereCreatedAt($value) |
34: | * @method static \Illuminate\Database\Eloquent\Builder|UserBlock whereEmail($value) |
35: | * @method static \Illuminate\Database\Eloquent\Builder|UserBlock whereErrorLoginsCount($value) |
36: | * @method static \Illuminate\Database\Eloquent\Builder|UserBlock whereId($value) |
37: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Core\Models\UserBlock whereIn(string $column, mixed $values, string $boolean = 'and', bool $not = false) |
38: | * @method static \Illuminate\Database\Eloquent\Builder|UserBlock whereIpAddress($value) |
39: | * @method static \Illuminate\Database\Eloquent\Builder|UserBlock whereTime($value) |
40: | * @method static \Illuminate\Database\Eloquent\Builder|UserBlock whereUpdatedAt($value) |
41: | * @method static \Illuminate\Database\Eloquent\Builder|UserBlock whereUserId($value) |
42: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Core\Models\UserBlock find(int|string $id, array|string $columns = ['*']) |
43: | * @method static int count(string $columns = '*') |
44: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Core\Models\UserBlock findOrFail(int|string $id, mixed $id, Closure|array|string $columns = ['*'], Closure $callback = null) |
45: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Core\Models\UserBlock first(array|string $columns = ['*']) |
46: | * @mixin \Eloquent |
47: | */ |
48: | class UserBlock extends Model |
49: | { |
50: | protected $table = 'core_user_blocks'; |
51: | protected $moduleName = 'Core'; |
52: | |
53: | protected $foreignModel = User::class; |
54: | protected $foreignModelIdColumn = 'UserId'; // Column that refers to an external table |
55: | |
56: | /** |
57: | * The attributes that are mass assignable. |
58: | * |
59: | * @var array |
60: | */ |
61: | protected $fillable = [ |
62: | 'Id', |
63: | 'UserId', |
64: | 'Email', |
65: | 'IpAddress', |
66: | 'ErrorLoginsCount', |
67: | 'Time', |
68: | 'Properties' |
69: | ]; |
70: | |
71: | /** |
72: | * The attributes that should be hidden for arrays. |
73: | * |
74: | * @var array |
75: | */ |
76: | protected $hidden = [ |
77: | ]; |
78: | |
79: | protected $casts = [ |
80: | 'Properties' => 'array', |
81: | ]; |
82: | |
83: | protected $attributes = [ |
84: | ]; |
85: | } |
86: |