PHP Class Bolt\EventListener\StorageEventListener

Inheritance: implements Symfony\Component\EventDispatcher\EventSubscriberInterface, use trait Bolt\Request\ProfilerAwareTrait
Datei anzeigen Open project: bolt/bolt Class Usage Examples

Protected Properties

Property Type Description
$hashStrength integer
$loggerFlash Bolt\Logger\FlashLoggerInterface
$passwordFactory PasswordLib\Password\Factory
$schemaManager Bolt\Storage\Database\Schema\SchemaManagerInterface
$timedRecord Bolt\Storage\EventProcessor\TimedRecord
$timedRecordsEnabled boolean
$urlGenerator Symfony\Component\Routing\Generator\UrlGeneratorInterface

Public Methods

Method Description
__construct ( TimedRecord $timedRecord, Bolt\Storage\Database\Schema\SchemaManagerInterface $schemaManager, Symfony\Component\Routing\Generator\UrlGeneratorInterface $urlGenerator, Bolt\Logger\FlashLoggerInterface $loggerFlash, PasswordLib\Password\Factory $passwordFactory, integer $hashStrength, boolean $timedRecordsEnabled ) Constructor.
getSubscribedEvents ( )
onKernelRequest ( GetResponseEvent $event ) Kernel request listener callback.
onPostHydrate ( Bolt\Events\HydrationEvent $event ) Post hydration storage event.
onUserEntityPreSave ( Bolt\Events\StorageEvent $event ) Pre-save storage event for user entities.

Protected Methods

Method Description
passwordHash ( Bolt\Storage\Entity\Users $usersEntity ) Hash user passwords on save.
schemaCheck ( GetResponseEvent $event ) Trigger database schema checks if required.

Private Methods

Method Description
getValidHash ( string $password ) : string Return a valid hash for a password, of if the password is already hashed just return as is.

Method Details

__construct() public method

Constructor.
public __construct ( TimedRecord $timedRecord, Bolt\Storage\Database\Schema\SchemaManagerInterface $schemaManager, Symfony\Component\Routing\Generator\UrlGeneratorInterface $urlGenerator, Bolt\Logger\FlashLoggerInterface $loggerFlash, PasswordLib\Password\Factory $passwordFactory, integer $hashStrength, boolean $timedRecordsEnabled )
$timedRecord Bolt\Storage\EventProcessor\TimedRecord
$schemaManager Bolt\Storage\Database\Schema\SchemaManagerInterface
$urlGenerator Symfony\Component\Routing\Generator\UrlGeneratorInterface
$loggerFlash Bolt\Logger\FlashLoggerInterface
$passwordFactory PasswordLib\Password\Factory
$hashStrength integer
$timedRecordsEnabled boolean

getSubscribedEvents() public static method

public static getSubscribedEvents ( )

onKernelRequest() public method

Kernel request listener callback.
public onKernelRequest ( GetResponseEvent $event )
$event Symfony\Component\HttpKernel\Event\GetResponseEvent

onPostHydrate() public method

Post hydration storage event.
public onPostHydrate ( Bolt\Events\HydrationEvent $event )
$event Bolt\Events\HydrationEvent

onUserEntityPreSave() public method

Pre-save storage event for user entities.
public onUserEntityPreSave ( Bolt\Events\StorageEvent $event )
$event Bolt\Events\StorageEvent

passwordHash() protected method

Hash user passwords on save.
protected passwordHash ( Bolt\Storage\Entity\Users $usersEntity )
$usersEntity Bolt\Storage\Entity\Users

schemaCheck() protected method

Trigger database schema checks if required.
protected schemaCheck ( GetResponseEvent $event )
$event Symfony\Component\HttpKernel\Event\GetResponseEvent

Property Details

$hashStrength protected_oe property

protected int $hashStrength
return integer

$loggerFlash protected_oe property

protected FlashLoggerInterface,Bolt\Logger $loggerFlash
return Bolt\Logger\FlashLoggerInterface

$passwordFactory protected_oe property

protected Factory,PasswordLib\Password $passwordFactory
return PasswordLib\Password\Factory

$schemaManager protected_oe property

protected SchemaManagerInterface,Bolt\Storage\Database\Schema $schemaManager
return Bolt\Storage\Database\Schema\SchemaManagerInterface

$timedRecord protected_oe property

protected TimedRecord,Bolt\Storage\EventProcessor $timedRecord
return Bolt\Storage\EventProcessor\TimedRecord

$timedRecordsEnabled protected_oe property

protected bool $timedRecordsEnabled
return boolean

$urlGenerator protected_oe property

protected UrlGeneratorInterface,Symfony\Component\Routing\Generator $urlGenerator
return Symfony\Component\Routing\Generator\UrlGeneratorInterface