i am using zfcuser, bjyauthorize et roleuserbridge. i want to add a field in the form registration. I followed this tutorial step : http://resoftsol.com/adding-custom-fields-to-zfcuser-register-form/
in the module front i have added : - the directory entity with files user et userinterface:
namespace Front\Entity;
interface UserInterface
{
/**
* Get id.
*
* @return int
*/
public function getId();
/**
* Set id.
*
* @param int $id
* @return UserInterface
*/
public function setId($id);
/**
* Get username.
*
* @return string
*/
public function getUsername();
/**
* Set username.
*
* @param string $username
* @return UserInterface
*/
public function setUsername($username);
/**
* Get email.
*
* @return string
*/
public function getEmail();
/**
* Set email.
*
* @param string $email
* @return UserInterface
*/
public function setEmail($email);
/**
* Get displayName.
*
* @return string
*/
public function getDisplayName();
/**
* Set displayName.
*
* @param string $displayName
* @return UserInterface
*/
public function setDisplayName($displayName);
/**
* Get password.
*
* @return string password
*/
public function getPassword();
/**
* Set password.
*
* @param string $password
* @return UserInterface
*/
public function setPassword($password);
/**
* Get state.
*
* @return int
*/
public function getState();
/**
* Set state.
*
* @param int $state
* @return UserInterface
*/
public function setState($state);
/**
* Get role.
*
* @return string
*/
public function getRole();
/**
* Set role.
*
* @param string $role
* @return UserInterface
*/
public function setRole($role);
}
++++++++++++++++++++
namespace Font\Entity;
class User implements UserInterface
{
/**
* @var int
*/
protected $id;
/**
* @var string
*/
protected $username;
/**
* @var string
*/
protected $email;
/**
* @var string
*/
protected $displayName;
/**
* @var string
*/
protected $password;
/**
* @var int
*/
protected $state;
/**
* @var string
*/
protected $role;
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set id.
*
* @param int $id
* @return UserInterface
*/
public function setId($id)
{
$this->id = (int) $id;
return $this;
}
/**
* Get username.
*
* @return string
*/
public function getUsername()
{
return $this->username;
}
/**
* Set username.
*
* @param string $username
* @return UserInterface
*/
public function setUsername($username)
{
$this->username = $username;
return $this;
}
/**
* Get email.
*
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* Set email.
*
* @param string $email
* @return UserInterface
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
/**
* Get displayName.
*
* @return string
*/
public function getDisplayName()
{
return $this->displayName;
}
/**
* Set displayName.
*
* @param string $displayName
* @return UserInterface
*/
public function setDisplayName($displayName)
{
$this->displayName = $displayName;
return $this;
}
/**
* Get password.
*
* @return string
*/
public function getPassword()
{
return $this->password;
}
/**
* Set password.
*
* @param string $password
* @return UserInterface
*/
public function setPassword($password)
{
$this->password = $password;
return $this;
}
/**
* Get state.
*
* @return int
*/
public function getState()
{
return $this->state;
}
/**
* Set state.
*
* @param int $state
* @return UserInterface
*/
public function setState($state)
{
$this->state = $state;
return $this;
}
/**
* Get role.
*
* @return string
*/
public function getRole()
{
return $this->role;
}
/**
* Set role.
*
* @param string $role
* @return UserInterface
*/
public function setRole($role)
{
$this->role = $role;
return $this;
}
} ++++++++++++++++++++++++++ also i have add the mapp directory. i had the following error :
Catchable fatal error: Argument 1 passed to ZfcUser\Validator\AbstractRecord::setMapper()
must be an instance of ZfcUser\Mapper\UserInterface, instance of Front\Mapper\User given,
called in C:\wamppp\www\projet\vendor\zendframework\zendframework\library\Zend\Validator
\AbstractValidator.php on line 139 and defined in C:\wamppp\www\projet\vendor\zf-commons
\zfc-user\src\ZfcUser\Validator\AbstractRecord.php on line 65