2022-10-01 12:21:42 +02:00
|
|
|
<?php
|
2022-10-16 19:29:53 +02:00
|
|
|
|
2022-10-01 12:21:42 +02:00
|
|
|
/*
|
|
|
|
* InvitedUser.php
|
|
|
|
* Copyright (c) 2022 james@firefly-iii.org
|
|
|
|
*
|
|
|
|
* This file is part of Firefly III (https://github.com/firefly-iii).
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2022-10-16 19:29:53 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2022-10-01 12:21:42 +02:00
|
|
|
namespace FireflyIII\Models;
|
|
|
|
|
2022-12-29 19:42:26 +01:00
|
|
|
use Eloquent;
|
2022-10-01 12:21:42 +02:00
|
|
|
use FireflyIII\User;
|
2022-12-29 19:42:26 +01:00
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
2022-10-01 12:21:42 +02:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
2022-12-31 15:54:55 +01:00
|
|
|
use Carbon\Carbon;
|
2022-10-01 12:21:42 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class InvitedUser
|
2022-12-11 10:32:25 +01:00
|
|
|
*
|
|
|
|
* @property-read User $user
|
2022-12-29 19:42:26 +01:00
|
|
|
* @method static Builder|InvitedUser newModelQuery()
|
|
|
|
* @method static Builder|InvitedUser newQuery()
|
|
|
|
* @method static Builder|InvitedUser query()
|
|
|
|
* @mixin Eloquent
|
|
|
|
* @property int $id
|
|
|
|
* @property Carbon|null $created_at
|
|
|
|
* @property Carbon|null $updated_at
|
|
|
|
* @property int $user_id
|
|
|
|
* @property string $email
|
|
|
|
* @property string $invite_code
|
|
|
|
* @property Carbon $expires
|
|
|
|
* @property bool $redeemed
|
|
|
|
* @method static Builder|InvitedUser whereCreatedAt($value)
|
|
|
|
* @method static Builder|InvitedUser whereEmail($value)
|
|
|
|
* @method static Builder|InvitedUser whereExpires($value)
|
|
|
|
* @method static Builder|InvitedUser whereId($value)
|
|
|
|
* @method static Builder|InvitedUser whereInviteCode($value)
|
|
|
|
* @method static Builder|InvitedUser whereRedeemed($value)
|
|
|
|
* @method static Builder|InvitedUser whereUpdatedAt($value)
|
|
|
|
* @method static Builder|InvitedUser whereUserId($value)
|
2022-10-01 12:21:42 +02:00
|
|
|
*/
|
|
|
|
class InvitedUser extends Model
|
|
|
|
{
|
|
|
|
protected $casts
|
|
|
|
= [
|
|
|
|
'expires' => 'datetime',
|
|
|
|
'redeemed' => 'boolean',
|
|
|
|
];
|
2022-12-29 19:42:26 +01:00
|
|
|
protected $fillable = ['user_id', 'email', 'invite_code', 'expires', 'redeemed'];
|
2022-10-01 12:21:42 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @codeCoverageIgnore
|
|
|
|
* @return BelongsTo
|
|
|
|
*/
|
|
|
|
public function user(): BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(User::class);
|
|
|
|
}
|
|
|
|
}
|