Thanks Steven! I'm using properties for most of my data, some of these need to be displayed and therefore I wished it were fields and I do not have to handle the display, unfortunately I'll have to live with either writing the display for the property or being ok with multiple tables for that field. <br>
<br><div class="gmail_quote">On Thu, Nov 17, 2011 at 10:48 PM, Steven Jones <span dir="ltr"><<a href="mailto:steven.jones@computerminds.co.uk">steven.jones@computerminds.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Mukesh,<br>
<br>
Instead of using fields you can use 'properties' of your entity, which<br>
are stored as additional columns on your entities' base table. You are<br>
fully responsible for providing widgets, display, loading and saving<br>
of these properties I believe, so you lose a lot. I'm not sure there<br>
is specific documentation about them anywhere, so I think you'll be<br>
down to looking at other code and inferring how they work. Potentially<br>
they are as simple as being extra columns on your base table that then<br>
get loaded and saved by your entity controller.<br>
<br>
I would suggest that you shouldn't really worry about the field data<br>
being stored in different tables, so long as you go through Drupal's<br>
APIs then you should even really need to know where your data is<br>
stored, or how it is stored.<br>
<br>
Hope that helps.<br>
<br>
Regards<br>
Steven Jones<br>
ComputerMinds ltd - Perfect Drupal Websites<br>
<br>
Phone : 024 7666 7277<br>
Mobile : 07702 131 576<br>
Twitter : darthsteven<br>
<a href="http://www.computerminds.co.uk" target="_blank">http://www.computerminds.co.uk</a><br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On 17 November 2011 04:25, Mukesh Agarwal <<a href="mailto:mukesh.agarwal17@gmail.com">mukesh.agarwal17@gmail.com</a>> wrote:<br>
> I'm using hook_field_info to define my new fields. I need to use this field<br>
> within a couple of entities and I dont need to have these fields in separate<br>
> tables. However when I try to define the schema of a field using<br>
> hook_field_schema I see that I need to mention the columns which means the<br>
> table for the field will be created when I create an instance of the field<br>
> with some entity. Is there a way out of this? Can I have my field data in<br>
> the same table as that of my entity (which is not a node but a custom<br>
> entity)?<br>
><br>
> --<br>
> Cheers,<br>
> Mukesh Agarwal<br>
> ________________________________<br>
> Innoraft Solutions || +91 8017220799<br>
><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Cheers,<div>Mukesh Agarwal</div><div>________________________________</div><div><font color="#999999"><a href="http://www.innoraft.com" target="_blank">Innoraft Solutions</a> || </font><span style="color:rgb(153, 153, 153)">+91 8017220799</span></div>
<br>