AppserverIo\Appserver\Core\Api\Node\SessionHandlerNodeInterface::getType PHP Method

getType() public method

Return's the session handler type.
public getType ( ) : string
return string The session handler type
    public function getType();

Usage Example

 /**
  * Create and return a new instance of the session handler with
  * the passed configuration.
  *
  * @param \AppserverIo\Appserver\Core\Api\Node\SessionHandlerNodeInterface $sessionHandlerNode The session handler configuration
  * @param \AppserverIo\Appserver\ServletEngine\SessionSettingsInterface    $sessionSettings    The session settings
  *
  * @return \AppserverIo\Appserver\ServletEngine\Session\SessionHandlerInterface The session handler instance
  */
 public static function create(SessionHandlerNodeInterface $sessionHandlerNode, SessionSettingsInterface $sessionSettings)
 {
     // reflect the class
     $reflectionClass = new ReflectionClass($sessionHandlerNode->getType());
     // create and initialize the session handler instance
     $sessionHandler = $reflectionClass->newInstanceArgs($sessionHandlerNode->getParamsAsArray());
     $sessionHandler->injectSessionSettings($sessionSettings);
     // return the initialzed instance
     return $sessionHandler;
 }
SessionHandlerNodeInterface