Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8457987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:57:23+00:00 2026-06-10T12:57:23+00:00

I am looking at an entity called content where I will store data about

  • 0

I am looking at an entity called content where I will store data about the content (textfield1, textfield2, bgcolor etc.) in an array inside the entity content (if this is not the best way to go please advice me).

The reason I want to put it in an array instead of just making separate entity fields for it is that I will have different ‘content templates’ so the amount and type of data fields will be different for each template (and each template of course has its own formbuilder; ContentXType.php, contentYType.php etc.). While one content type might have only one textfield, another might have 10.
I initially started on a design with datafield1, datafield2 etc. but realized that will leave me with a bunch of nullvalues and won’t really be pretty =)

At savetime I will generate an html output for this content in a different field called contentRendered.

At edit time I will again want to be able to open up the different datafields from my array in different form widgets, so for example textfield1 in a textfield, textfield2 in a textarea, and bgcolor (the third value of my array) in a colorpicker form widget (I guess I will use a textfield with a jQuery color picker widget).

So my little issue is whether entity type array is the best way to go for this, can I even from within my form builder pick out value 1 from the array and put that in one field, value 2 in a different form field etc.?

Or do I need to go with say a new entity called content_data and use relations?

Or would a better way to go be to define a new entity for each kind of content I plan on using, and then embedding a form for that content type in my main content form?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:57:24+00:00Added an answer on June 10, 2026 at 12:57 pm

    After some more research I will define a new entity for template in which I will specify my templates, and have different twig files for the rendering of each template.
    The actual data for each template, which will be of variable amount of fields, will be stored in a serialized array.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple entity called Store built in Xcode's data modeler for use
I've got new project on the go and I'm looking at using the Entity
Looking to do a bit of refactoring... Using NHibernate I have this query currently
Looking for a perl one-liner what will find all words with the next pattern:
Looking for best advice on how to do this: I have an insert like
Our organization is looking to standardize on Entity Framework once v4 comes out. As
I am looking to use Entity framework as database layer in my application, but
Lets say I have an entity called User which has many Posts. My service
i defined an entity called Variable and derived classes by using Table Per Hierarchy
Just started looking into Entity Framework and the new Code-First features. My question is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.