| 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\CpanelIntegrator\Models; |
| 9: | |
| 10: | use Aurora\System\Classes\Model; |
| 11: | use Aurora\Modules\Mail\Models\MailAccount; |
| 12: | |
| 13: | /** |
| 14: | * Aurora\Modules\CpanelIntegrator\Models\Alias |
| 15: | * |
| 16: | * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0 |
| 17: | * @license https://afterlogic.com/products/common-licensing Afterlogic Software License |
| 18: | * @copyright Copyright (c) 2023, Afterlogic Corp. |
| 19: | * @property int $IdUser |
| 20: | * @property integer $Id |
| 21: | * @property integer $IdAccount |
| 22: | * @property string $Email |
| 23: | * @property string $ForwardTo |
| 24: | * @property string $FriendlyName |
| 25: | * @property integer $UseSignature |
| 26: | * @property string $Signature |
| 27: | * @property \Illuminate\Support\Carbon|null $CreatedAt |
| 28: | * @property \Illuminate\Support\Carbon|null $UpdatedAt |
| 29: | * @property-read mixed $entity_id |
| 30: | * @method static int count(string $columns = '*') |
| 31: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\CpanelIntegrator\Models\Alias find(int|string $id, array|string $columns = ['*']) |
| 32: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\CpanelIntegrator\Models\Alias findOrFail(int|string $id, mixed $id, Closure|array|string $columns = ['*'], Closure $callback = null) |
| 33: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\CpanelIntegrator\Models\Alias first(array|string $columns = ['*']) |
| 34: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\CpanelIntegrator\Models\Alias firstWhere(Closure|string|array|\Illuminate\Database\Query\Expression $column, mixed $operator = null, mixed $value = null, string $boolean = 'and') |
| 35: | * @method static \Illuminate\Database\Eloquent\Builder|Alias newModelQuery() |
| 36: | * @method static \Illuminate\Database\Eloquent\Builder|Alias newQuery() |
| 37: | * @method static \Illuminate\Database\Eloquent\Builder|Alias query() |
| 38: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\CpanelIntegrator\Models\Alias where(Closure|string|array|\Illuminate\Database\Query\Expression $column, mixed $operator = null, mixed $value = null, string $boolean = 'and') |
| 39: | * @method static \Illuminate\Database\Eloquent\Builder|Alias whereCreatedAt($value) |
| 40: | * @method static \Illuminate\Database\Eloquent\Builder|Alias whereEmail($value) |
| 41: | * @method static \Illuminate\Database\Eloquent\Builder|Alias whereForwardTo($value) |
| 42: | * @method static \Illuminate\Database\Eloquent\Builder|Alias whereFriendlyName($value) |
| 43: | * @method static \Illuminate\Database\Eloquent\Builder|Alias whereId($value) |
| 44: | * @method static \Illuminate\Database\Eloquent\Builder|Alias whereIdAccount($value) |
| 45: | * @method static \Illuminate\Database\Eloquent\Builder|Alias whereIdUser($value) |
| 46: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\CpanelIntegrator\Models\Alias whereIn(string $column, mixed $values, string $boolean = 'and', bool $not = false) |
| 47: | * @method static \Illuminate\Database\Eloquent\Builder|Alias whereSignature($value) |
| 48: | * @method static \Illuminate\Database\Eloquent\Builder|Alias whereUpdatedAt($value) |
| 49: | * @method static \Illuminate\Database\Eloquent\Builder|Alias whereUseSignature($value) |
| 50: | * @mixin \Eloquent |
| 51: | */ |
| 52: | class Alias extends Model |
| 53: | { |
| 54: | protected $table = 'cpanel_aliases'; |
| 55: | |
| 56: | protected $foreignModel = MailAccount::class; |
| 57: | protected $foreignModelIdColumn = 'IdAccount'; // Column that refers to an external table |
| 58: | |
| 59: | protected $fillable = [ |
| 60: | 'Id', |
| 61: | 'IdUser', |
| 62: | 'IdAccount', |
| 63: | 'Email', |
| 64: | 'ForwardTo', |
| 65: | 'FriendlyName', |
| 66: | 'UseSignature', |
| 67: | 'Signature' |
| 68: | ]; |
| 69: | |
| 70: | protected $appends = [ |
| 71: | 'EntityId' |
| 72: | ]; |
| 73: | |
| 74: | public function getEntityIdAttribute() |
| 75: | { |
| 76: | return $this->Id; |
| 77: | } |
| 78: | |
| 79: | public function __construct(array $attributes = []) |
| 80: | { |
| 81: | parent::__construct($attributes); |
| 82: | $this->Signature = ''; |
| 83: | } |
| 84: | } |
| 85: |