mardi 4 novembre 2014

How to store system settings in entity


Vote count:

0




I'm currently doing system, which settings should be editable by admin. He cannot add them, but only choose/edit from existing one.


All the backend is done in Sonata.


Settings class:



class SystemSettings
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;

/**
* @ORM\Column(name="key", type="string", nullable=true)
*/
private $key;

/**
* @ORM\Column(name="value", type="string", nullable=true)
*/
private $value;
}


Problem is that I have different value types to store. I have some booleans, lists, integers, etc. For example I want to display array of languages as a list, but when it comes to "posts on page" setting, user should be able to write down any integer he wants. Is there any proper way to store it and display?



asked 33 secs ago

Mati

420






How to store system settings in entity

Aucun commentaire:

Enregistrer un commentaire