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

manage entity with file #30

Open
yusleyorea opened this issue Oct 28, 2016 · 1 comment
Open

manage entity with file #30

yusleyorea opened this issue Oct 28, 2016 · 1 comment

Comments

@yusleyorea
Copy link

I'm trying to manipulate an attached entity representing the files with a document entity, but can not find how to do it from the documentation in http://lakion.com/lionframe. Is there any tutorial or example where it can guide me.

Another thing, I'm trying to set the serialization of an entity that inherits from FOSUser model, to not display the password field among others, but it does not work either :-( looks so my yml:

Custom\UserBundle\Entity\User:
  exclusion_policy: ALL
  xml_root_name: user
  properties:
      id:
          expose: true
          type: integer
          xml_attribute: true
      email:
          expose: true
          type: string
      displayname:
          expose: true
          type: string
      password:
          expose: false
      salt:
          expose: false
      email_canonical:
          expose: false
      username_canonical:
          expose: false
      username:
          expose: false
      credentials_expired:
          expose: false
      expired:
          expose: false
      locked:
          expose: false

I am also try removing filds with expose false, but it always get all fields from the both entities.

@lchrusciel
Copy link
Member

Lionframe is based on jmsserializer, so probably you will need to look for an answer in theirs documentation.

Unfortunately, mappings are not inherited. If you want to change a default FOSUser model mapping, you have to define custom mapping in config file, and then change definition for this model only.

jms_serializer:
    metadata:
        directories:
            fos-user:
                namespace_prefix: "FOS\\UserBundle\\Model"
                path: "@AppBundle/Resources/config/serializer/fos"

Then in src/AppBundle/Resources/config/serializer/fos you can adjust your configuration.

Anyway, please ask such question on stackoverflow.

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

No branches or pull requests

2 participants