| 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\Mail\Models; |
| 9: | |
| 10: | /** |
| 11: | * Aurora\Modules\Mail\Models\Fetcher |
| 12: | * |
| 13: | * @property integer $Id |
| 14: | * @property integer $IdUser |
| 15: | * @property integer $IdAccount |
| 16: | * @property integer $IsEnabled |
| 17: | * @property string $IncomingServer |
| 18: | * @property integer $IncomingPort |
| 19: | * @property integer $IncomingMailSecurity |
| 20: | * @property string $IncomingLogin |
| 21: | * @property string $IncomingPassword |
| 22: | * @property integer $LeaveMessagesOnServer |
| 23: | * @property string $Folder |
| 24: | * @property integer $IsOutgoingEnabled |
| 25: | * @property string $Name |
| 26: | * @property string $Email |
| 27: | * @property string $OutgoingServer |
| 28: | * @property integer $OutgoingPort |
| 29: | * @property integer $OutgoingMailSecurity |
| 30: | * @property integer $OutgoingUseAuth |
| 31: | * @property integer $UseSignature |
| 32: | * @property string $Signature |
| 33: | * @property integer $IsLocked |
| 34: | * @property integer $CheckInterval |
| 35: | * @property integer $CheckLastTime |
| 36: | * @property \Illuminate\Support\Carbon|null $CreatedAt |
| 37: | * @property \Illuminate\Support\Carbon|null $UpdatedAt |
| 38: | * @property-read mixed $entity_id |
| 39: | * @method static int count(string $columns = '*') |
| 40: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Mail\Models\Fetcher find(int|string $id, array|string $columns = ['*']) |
| 41: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Mail\Models\Fetcher findOrFail(int|string $id, mixed $id, Closure|array|string $columns = ['*'], Closure $callback = null) |
| 42: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Mail\Models\Fetcher first(array|string $columns = ['*']) |
| 43: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Mail\Models\Fetcher firstWhere(Closure|string|array|\Illuminate\Database\Query\Expression $column, mixed $operator = null, mixed $value = null, string $boolean = 'and') |
| 44: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher newModelQuery() |
| 45: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher newQuery() |
| 46: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher query() |
| 47: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Mail\Models\Fetcher where(Closure|string|array|\Illuminate\Database\Query\Expression $column, mixed $operator = null, mixed $value = null, string $boolean = 'and') |
| 48: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereCheckInterval($value) |
| 49: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereCheckLastTime($value) |
| 50: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereCreatedAt($value) |
| 51: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereEmail($value) |
| 52: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereFolder($value) |
| 53: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereId($value) |
| 54: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereIdAccount($value) |
| 55: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereIdUser($value) |
| 56: | * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Mail\Models\Fetcher whereIn(string $column, mixed $values, string $boolean = 'and', bool $not = false) |
| 57: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereIncomingLogin($value) |
| 58: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereIncomingMailSecurity($value) |
| 59: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereIncomingPassword($value) |
| 60: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereIncomingPort($value) |
| 61: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereIncomingServer($value) |
| 62: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereIsEnabled($value) |
| 63: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereIsLocked($value) |
| 64: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereIsOutgoingEnabled($value) |
| 65: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereLeaveMessagesOnServer($value) |
| 66: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereName($value) |
| 67: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereOutgoingMailSecurity($value) |
| 68: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereOutgoingPort($value) |
| 69: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereOutgoingServer($value) |
| 70: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereOutgoingUseAuth($value) |
| 71: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereSignature($value) |
| 72: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereUpdatedAt($value) |
| 73: | * @method static \Illuminate\Database\Eloquent\Builder|Fetcher whereUseSignature($value) |
| 74: | * @mixin \Eloquent |
| 75: | */ |
| 76: | class Fetcher extends \Aurora\System\Classes\Model |
| 77: | { |
| 78: | protected $table = 'mail_fetchers'; |
| 79: | protected $fillable = [ |
| 80: | 'Id', |
| 81: | 'IdUser', |
| 82: | 'IdAccount', |
| 83: | |
| 84: | 'IsEnabled', |
| 85: | 'IncomingServer', |
| 86: | 'IncomingPort', |
| 87: | 'IncomingMailSecurity', |
| 88: | 'IncomingLogin', |
| 89: | 'IncomingPassword', |
| 90: | 'LeaveMessagesOnServer', |
| 91: | 'Folder', |
| 92: | |
| 93: | 'IsOutgoingEnabled', |
| 94: | 'Name', |
| 95: | 'Email', |
| 96: | 'OutgoingServer', |
| 97: | 'OutgoingPort', |
| 98: | 'OutgoingMailSecurity', |
| 99: | 'OutgoingUseAuth', |
| 100: | |
| 101: | 'UseSignature', |
| 102: | 'Signature', |
| 103: | |
| 104: | 'IsLocked', |
| 105: | 'CheckInterval', |
| 106: | 'CheckLastTime' |
| 107: | ]; |
| 108: | |
| 109: | protected $casts = [ |
| 110: | 'Properties' => 'array', |
| 111: | 'IncomingPassword' => \Aurora\System\Casts\Encrypt::class |
| 112: | ]; |
| 113: | |
| 114: | protected $appends = [ |
| 115: | 'EntityId' |
| 116: | ]; |
| 117: | |
| 118: | public function getEntityIdAttribute() |
| 119: | { |
| 120: | return $this->Id; |
| 121: | } |
| 122: | |
| 123: | public function toResponseArray() |
| 124: | { |
| 125: | $aResponse = parent::toResponseArray(); |
| 126: | $aResponse['IncomingUseSsl'] = $aResponse['IncomingMailSecurity'] === \MailSo\Net\Enumerations\ConnectionSecurityType::SSL; |
| 127: | unset($aResponse['IncomingMailSecurity']); |
| 128: | $aResponse['OutgoingUseSsl'] = $aResponse['OutgoingMailSecurity'] === \MailSo\Net\Enumerations\ConnectionSecurityType::SSL; |
| 129: | unset($aResponse['OutgoingMailSecurity']); |
| 130: | unset($aResponse['IncomingPassword']); |
| 131: | return $aResponse; |
| 132: | } |
| 133: | } |
| 134: |