Closed ezpoko closed 9 years ago
What do you got instead of FOS\UserBundle\Controller\RegistrationController ?
Thanks for your answer. But what do you really mean? Here is the all error :
Catchable Fatal Error: Argument 3 passed to PUGX\MultiUserBundle\Controller\RegistrationManager::__construct() must be an instance of FOS\UserBundle\Controller\RegistrationController, instance of BB\UserBundle\Controller\RegistrationController given, called in D:\www\dev.localhost\app\cache\dev\appDevDebugProjectContainer.php on line 2630 and defined
The error occured even if the cache is cleared. I'm using symfony 2.60
Thanks
The error is quite clear:
must be an instance of FOS\UserBundle\Controller\RegistrationController, instance of BB\UserBundle\Controller\RegistrationController given
use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Model\GroupInterface;
use FOS\UserBundle\Model\User as BaseUser;
/**
* @ORM\Entity
* @ORM\Table(name="fos_user")
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="type", type="string")
* @ORM\DiscriminatorMap({"administrator" = "Administrator", "employee" = "Employee", "participant" = "Participant", "recruiter" = "Recruiter", "individual" = "Individual"})
* @ORM\HasLifecycleCallbacks()
* @ORM\Entity(repositoryClass="BB\UserBundle\Entity\UserRepository")
*
*/
abstract class User extends BaseUser
{
}
/**
* Employee
*
* @ORM\Table(name="employee")
* @ORM\Entity(repositoryClass="BB\UserBundle\Entity\EmployeeRepository")
* @UniqueEntity(fields = "username", targetClass = "BB\UserBundle\Entity\User", message="fos_user.username.already_used")
* @UniqueEntity(fields = "email", targetClass = "BB\UserBundle\Entity\User", message="fos_user.email.already_used")
*/
class Employee extends User
{
}
namespace BB\UserBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class RegistrationEmployeeController extends Controller
{
/**
* Add a new Employee
* @return type
*/
public function registerAction()
{
return $this->container
->get('pugx_multi_user.registration_manager')
->register('BB\UserBundle\Entity\Employee');
}
}
Where's the mistake ?
You must extends FOS\UserBundle\Controller\RegistrationController
The problem is solved. Thanks a lot.
Hi,
I'm training to register a new user but can't do it due to the following catchable error.