Admin
6 months ago
Compatibility
6 months ago
Helpers
6 months ago
Providers
6 months ago
Queue
6 months ago
Reports
6 months ago
Tasks
6 months ago
UsageTracking
6 months ago
AbstractConnection.php
6 months ago
Conflicts.php
6 months ago
Connect.php
6 months ago
Connection.php
6 months ago
ConnectionInterface.php
6 months ago
ConnectionsManager.php
6 months ago
Core.php
6 months ago
DBRepair.php
6 months ago
Debug.php
6 months ago
Geo.php
6 months ago
MailCatcher.php
6 months ago
MailCatcherInterface.php
6 months ago
MailCatcherTrait.php
6 months ago
MailCatcherV6.php
6 months ago
Migration.php
6 months ago
MigrationAbstract.php
6 months ago
Migrations.php
6 months ago
OptimizedEmailSending.php
6 months ago
Options.php
6 months ago
Processor.php
6 months ago
SiteHealth.php
6 months ago
Upgrade.php
6 months ago
Uploads.php
6 months ago
WP.php
6 months ago
WPMailArgs.php
6 months ago
WPMailInitiator.php
6 months ago
Connection.php
79 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WPMailSMTP; |
| 4 | |
| 5 | /** |
| 6 | * Class Connection. |
| 7 | * |
| 8 | * @since 3.7.0 |
| 9 | */ |
| 10 | class Connection extends AbstractConnection { |
| 11 | |
| 12 | /** |
| 13 | * Connection Options object. |
| 14 | * |
| 15 | * @since 3.7.0 |
| 16 | * |
| 17 | * @var Options |
| 18 | */ |
| 19 | private $options; |
| 20 | |
| 21 | /** |
| 22 | * Constructor. |
| 23 | * |
| 24 | * @since 3.7.0 |
| 25 | */ |
| 26 | public function __construct() { |
| 27 | |
| 28 | $this->options = Options::init(); |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * Get the connection identifier. |
| 33 | * |
| 34 | * @since 3.7.0 |
| 35 | * |
| 36 | * @return string |
| 37 | */ |
| 38 | public function get_id() { |
| 39 | |
| 40 | return 'primary'; |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Get the connection name. |
| 45 | * |
| 46 | * @since 3.7.0 |
| 47 | * |
| 48 | * @return string |
| 49 | */ |
| 50 | public function get_name() { |
| 51 | |
| 52 | return esc_html__( 'Primary', 'wp-mail-smtp' ); |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Get connection options object. |
| 57 | * |
| 58 | * @since 3.7.0 |
| 59 | * |
| 60 | * @return Options |
| 61 | */ |
| 62 | public function get_options() { |
| 63 | |
| 64 | return $this->options; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Whether the connection is primary or not. |
| 69 | * |
| 70 | * @since 3.7.0 |
| 71 | * |
| 72 | * @return bool |
| 73 | */ |
| 74 | public function is_primary() { |
| 75 | |
| 76 | return true; |
| 77 | } |
| 78 | } |
| 79 |