I'm using Symfony2, FOSRestBundle and NelApiDoc to create Rest services.
Documentation created by NelMioApiDoc I have a field that is defined as a choice and extracts all the records in the database. How can I tell NelMioApiDoc to hide values retrieved from database?
Thanks for the answers
I think this is your answer, once it is merged:
https://github.com/nelmio/NelmioApiDocBundle/pull/543
Related
I have a Symfony app using multiple entities.
A third-party analytic tool plugs to my database to create reportings.
What I would like to achieve, is being able to update the Symfony entity from the frontend in order to add new fields to the database tables (in order to get the new fields showing up in the reporting tool).
Anyone has a idea on how to achieve that?
Thanks in advance.
If i understand correctly, you wan't to be able to add fields to your entity dynamicaly.
I don't know if this is doable and if so, it would probably be messy and unsecure.
What you can do however is using sub-entities with dynamic key => values fields.
You should have one main entity, an entity with the list of your dynamic fields, a many to many relation between your main entity and your fields entities and a third entity with the actual values from those fields.
Is it possible to have behaviors in Symfony 2 entities, like in CakePHP? I'll try to explain what I need:
In some of my entities, I need to store who created or updated the record, when it was created or updated, at which company does it belongs and at which season does it belongs.
All these data is stored in the session, and I want to add it to the entity "magically", without adding these fields in the controller. With CakePHP I can create SeasonBehavior, mark some models/entities as they use the SeasonBehavior and when I persist a record from an entity marked with the SeasonBehavior the seasonId is updated.
Is it possible to do the same with Symfony2 and Doctrine 2? And if it's possible, do you know any tutorial or documentation explaining how to do this?
You need to create listener on your Persist action to do such things. Read the manual here: http://symfony.com/doc/current/cookbook/doctrine/event_listeners_subscribers.html
I have the following scenario:
My website db has a system table called "Companies", which includes an id field, companyName field, and companyImageUrl field.
How do I set up an umbraco document type for adding entries to this table ?
Maybe I shouldn't use a custom table at all ?
Thanks.
As far as I know, Umbraco doesn't support what you want to do out of the box (mapping a document type to a table that isn't part of the umbraco core).
One approach that might work is to create an action handler that syncs a Company doc type to your table when creating a node of that type.
It's a bit of a hack though. I've found that I've very rarely needed to create custom tables. What exactly are you trying to do with it? My guess is that you don't really need it and would be better off working with a doc type instead. Umbraco provides a variety of ways to get and act upon doc types from within custom C# code (check out the umbraco.NodeFactory namespace). You'll also get the added benefit of being able to easily interact with these nodes from XSLT/Razor.
I am trying to create an index in raven that will (to all intents and purposes) project all comments on all blog-posts that were created by a specific user. At present I have managed a map statement, which only returns the posts that have comments.
from post in docs.Posts
from comment in Hierarchy(post, "Comments")
select new { comment.User, comment.Text }
At the end of this, I will want to page through the comments, so I need to get a flat list of all matching items.
Thanks
What is the problem that you have run to?
You are projecting the comment data out, you need to tell RavenDB to store the fields, but you can now query it just fine.
Can someone please tell me how to add duration(CCK field) to sort criteria of views programmatically because it is not listed there by default?
If no handler/field is provided in Views you have to refer to the API and write the views plugins to enable what you want to sort by.
http://views2.logrus.com/doc/html/index.html
http://drupal.org/node/235062