I'm facing some troubles to make a static array, giving some static attributes of the class as keys of the static array, something like this:
class A {
private $ambito; //will be filled with an element of the static $ambitos
public static $municipal = 1;
public static $provincial = 2;
public static $regional = 3;
/*array para declarar los posibles ambitos de visualizacion de una empresa*/
private static $ambitos = array(
self::$municipal => "Municipal",
self::$provincial => "Provincial",
self::$regional => "Regional"
);
public static function getAmbitos()
{
return self::$ambitos;
}
}
The problem is that I can't use self:$municipal inside the static array, because it fire an error, I only can use literal integer (is how I saved in the database)
I'm using symphony 2.0.
Thanks!