Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindUsers by type #73

Open
walemos opened this issue Nov 5, 2014 · 1 comment
Open

FindUsers by type #73

walemos opened this issue Nov 5, 2014 · 1 comment

Comments

@walemos
Copy link

walemos commented Nov 5, 2014

How access the variable type created in this bundle?

/**

  • @Orm\Entity
  • @Orm\Table(name="fos_user")
  • @Orm\InheritanceType("JOINED")
  • @Orm\DiscriminatorColumn(name="type", type="string") <--------<-------
  • @Orm\DiscriminatorMap({"user_musico" = "UserMusico", "user_espaco" = "UserEspaco"})
    */
    abstract class User extends BaseUser {
@glukose
Copy link

glukose commented Mar 9, 2015

I asked myself the same question no so long ago. I couldn't.
So I used that code :

$discriminator = $this->container->get('pugx_user.manager.user_discriminator');
if($discriminator->getClass() == 'UserBundle\Entity\Utilisateur'){
} else { ... }

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

No branches or pull requests

2 participants