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: | * |
19: | * @property int $Id Object primary key |
20: | * @property int $UserId User ID of the user blocked |
21: | * @property string $Email Public ID of the user blocked |
22: | * @property string $IpAddress IP address recorded for the user block |
23: | * @property int $ErrorLoginsCount Number of failed login attempts |
24: | * @property int $Time Timestamp when user block added |
25: | * @property array $Properties Custom properties for use by other modules |
26: | */ |
27: | class UserBlock extends Model |
28: | { |
29: | protected $table = 'core_user_blocks'; |
30: | protected $moduleName = 'Core'; |
31: | |
32: | protected $foreignModel = User::class; |
33: | protected $foreignModelIdColumn = 'UserId'; // Column that refers to an external table |
34: | |
35: | /** |
36: | * The attributes that are mass assignable. |
37: | * |
38: | * @var array |
39: | */ |
40: | protected $fillable = [ |
41: | 'Id', |
42: | 'UserId', |
43: | 'Email', |
44: | 'IpAddress', |
45: | 'ErrorLoginsCount', |
46: | 'Time', |
47: | 'Properties' |
48: | ]; |
49: | |
50: | /** |
51: | * The attributes that should be hidden for arrays. |
52: | * |
53: | * @var array |
54: | */ |
55: | protected $hidden = [ |
56: | ]; |
57: | |
58: | protected $casts = [ |
59: | 'Properties' => 'array', |
60: | ]; |
61: | |
62: | protected $attributes = [ |
63: | ]; |
64: | } |
65: |