function FileTransfer::__get

Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/FileTransfer/FileTransfer.php \Drupal\Core\FileTransfer\FileTransfer::__get()
  2. 11.x core/lib/Drupal/Core/FileTransfer/FileTransfer.php \Drupal\Core\FileTransfer\FileTransfer::__get()
  3. 9 core/lib/Drupal/Core/FileTransfer/FileTransfer.php \Drupal\Core\FileTransfer\FileTransfer::__get()
  4. 8.9.x core/lib/Drupal/Core/FileTransfer/FileTransfer.php \Drupal\Core\FileTransfer\FileTransfer::__get()

Implementation of the magic __get() method.

If the connection isn't set to anything, this will call the connect() method and set it to and return the result; afterwards, the connection will be returned directly without using this method.

File

includes/filetransfer/filetransfer.inc, line 53

Class

FileTransfer
#[AllowDynamicProperties]

Code

function __get($name) {
  if ($name == 'connection') {
    $this->connect();
    return $this->connection;
  }
  if ($name == 'chroot') {
    $this->setChroot();
    return $this->chroot;
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.