/** * Returns the login attempts for the given username. * * Returns NULL in case there are no current failed login attempts for the given user. * * @param string $username Username to return the login attempts for * @return \Ableron\Plugins\BruteForceProtector\Model\Entities\LoginAttemptsEntity|null */ public static function getLoginAttemptsByUsername($username) { return Application::getPersistenceManager()->getRepository('LoginAttemptsEntity', BruteForceProtectorPlugin::getNamespace())->findOneBy(array('username' => $username)); }
public function testGetNamespace() { $this->assertSame('Core', CoreModule::getNamespace()); $this->assertSame('BruteForceProtector', BruteForceProtectorPlugin::getNamespace()); }