Skip to content

Instantly share code, notes, and snippets.

@tight
Created May 28, 2010 06:57
Show Gist options
  • Save tight/416854 to your computer and use it in GitHub Desktop.
Save tight/416854 to your computer and use it in GitHub Desktop.
<?php
// lib/form/BaseForm.class.php
/**
* Base project form.
*
* @package peanut
* @subpackage form
* @author Alexandre 'pocky' BALMES
* @version SVN: $Id: BaseForm.class.php 20147 2009-07-13 11:46:57Z FabianLange $
*/
class BaseForm extends sfFormSymfony
{
static protected $userForm = null;
static protected function getUser()
{
return self::$userForm;
}
static public function getValidUser()
{
if (!self::$userForm instanceof sfBasicSecurityUser)
{
throw new RuntimeException('No valid user instance available');
}
return self::$userForm;
}
static public function setUser(sfBasicSecurityUser $user)
{
self::$userForm = $user;
}
}
@tight
Copy link
Author

tight commented May 28, 2010

Ton BaseForm.class.php définisait une propriété static $user (la modif de @n1k0 sur les forms / users) et sfGuardRequestForgotPasswordForm définit aussi une propriété $user (non static, mais on s'en fout). Or sfGuardRequestForgotPasswordForm étend BaseForm, d'où le conflit au niveau des propriétés

@pocky
Copy link

pocky commented May 28, 2010

J'ai fermé le ticket correspondant grâce a toi donc merci !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment