class SimpleFbConnectPersistentDataHandler in Simple FB Connect 8.3
Variables are written to and read from session via this class.
By default, Facebook SDK uses native PHP sessions for storing data. We implement Facebook\PersistentData\PersistentDataInterface using Symfony Sessions so that Facebook SDK will use that instead of native PHP sessions. Also SimpleFbConnect reads data from and writes data to session via this class.
Hierarchy
- class \Drupal\simple_fb_connect\SimpleFbConnectPersistentDataHandler implements \Facebook\PersistentData\PersistentDataInterface
Expanded class hierarchy of SimpleFbConnectPersistentDataHandler
See also
https://developers.facebook.com/docs/php/PersistentDataInterface/5.0.0
3 files declare their use of SimpleFbConnectPersistentDataHandler
- SimpleFbConnectController.php in src/
Controller/ SimpleFbConnectController.php - SimpleFbConnectPersistentDataHandlerTest.php in tests/
src/ Unit/ SimpleFbConnectPersistentDataHandlerTest.php - UserHasFacebookAccessToken.php in modules/
simple_fb_connect_rules/ src/ Plugin/ Condition/ UserHasFacebookAccessToken.php
1 string reference to 'SimpleFbConnectPersistentDataHandler'
1 service uses SimpleFbConnectPersistentDataHandler
File
- src/
SimpleFbConnectPersistentDataHandler.php, line 19
Namespace
Drupal\simple_fb_connectView source
class SimpleFbConnectPersistentDataHandler implements PersistentDataInterface {
protected $session;
protected $sessionPrefix = 'simple_fb_connect_';
/**
* Constructor.
*
* @param \Symfony\Component\HttpFoundation\Session\SessionInterface $session
* Used for reading data from and writing data to session.
*/
public function __construct(SessionInterface $session) {
$this->session = $session;
}
/**
* {@inheritdoc}
*/
public function get($key) {
return $this->session
->get($this->sessionPrefix . $key);
}
/**
* {@inheritdoc}
*/
public function set($key, $value) {
$this->session
->set($this->sessionPrefix . $key, $value);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SimpleFbConnectPersistentDataHandler:: |
protected | property | ||
SimpleFbConnectPersistentDataHandler:: |
protected | property | ||
SimpleFbConnectPersistentDataHandler:: |
public | function | ||
SimpleFbConnectPersistentDataHandler:: |
public | function | ||
SimpleFbConnectPersistentDataHandler:: |
public | function | Constructor. |