1
votes

I user FOSUserBundle to generate User entity and table. I just don't understand the value of roles column in User table. For example, the default value is like "a:0:{}", the ROLE_ADMIN value is like "a:1:{i:0;s:16:"ROLE_SUPER_ADMIN";}". What is the meaning of "a", "i", "s" and the numbers?

1
It is PHP serialization format of an array - dev-null-dweller

1 Answers

4
votes

What you are seeing is the serialized value of an array. "a" means "array":1(length), "i" means "index":0(index), "s" means "string":16(length)

This is equivalent to:

array(0=>"ROLE_SUPER_ADMIN")

so "a:0:{}" would be

array()