'array', 'servers' => 'array', ]; /** * @throws \Exception */ public function __get($key) { switch ($key) { case 'binkp_bind': case 'dns_bind': case 'emsi_bind': case 'ansitex_bind': case 'videotex_bind': return Arr::get($this->servers,str_replace('_','.',$key),self::BIND); case 'binkp_port': return Arr::get($this->servers,str_replace('_','.',$key),Binkp::PORT); case 'dns_port': return Arr::get($this->servers,str_replace('_','.',$key),DNS::PORT); case 'emsi_port': return Arr::get($this->servers,str_replace('_','.',$key),EMSI::PORT); case 'ansitex_port': return Arr::get($this->servers,str_replace('_','.',$key),Ansitex::PORT); case 'videotex_port': return Arr::get($this->servers,str_replace('_','.',$key),Videotex::PORT); case 'options_options': return Arr::get($this->options,'options'); case 'binkp_active': case 'dns_active': case 'emsi_active': case 'binkp_options': case 'dns_options': case 'emsi_options': return Arr::get($this->servers,str_replace('_','.',$key)); case 'msgs_pkt': return Arr::get($this->options,$key,self::MAX_MSGS_PKT); case 'version': return File::exists('VERSION') ? chop(File::get('VERSION')) : 'dev'; default: return parent::__get($key); } } /** * @throws \Exception */ public function __set($key,$value) { switch ($key) { case 'binkp_bind': case 'binkp_port': case 'binkp_options': case 'dns_bind': case 'dns_port': case 'dns_options': case 'emsi_bind': case 'emsi_port': case 'emsi_options': return Arr::set($this->servers,str_replace('_','.',$key),$value); default: parent::__set($key,$value); } } /** * The Mailer Product ID in hex. * * @param int $c * @return string * @throws \Exception */ public static function product_id(int $c=self::PRODUCT_ID): string { return hexstr($c); } /* RELATIONS */ /** * The defined system that this setup is valid for * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function system() { return $this->belongsTo(System::class); } /* METHODS */ public function optionClear(int $key,$index='option_options'): void { $this->{$index} &= ~$key; } public function optionGet(int $key,$index='option_options'): int { return ($this->{$index} & $key); } public function optionSet(int $key,$index='option_options'): void { $this->{$index} |= $key; } }