php更新静态属性数组
你好 我已将数组定义为父级中的静态属性 在子数组中,需要相同的数组,但在此数组中需要另一个值 我重新定义数组并覆盖父数组 问题: 是否有其他方法可以在不重新定义的情况下在数组中添加新值php更新静态属性数组,php,overriding,class-properties,Php,Overriding,Class Properties,你好 我已将数组定义为父级中的静态属性 在子数组中,需要相同的数组,但在此数组中需要另一个值 我重新定义数组并覆盖父数组 问题: 是否有其他方法可以在不重新定义的情况下在数组中添加新值 class message extends AbstractModel { protected static $schema = ['text' => self::DATA_TYPE_STR, 'id' => self::DATA_TYPE_INT,
class message extends AbstractModel
{
protected static $schema =
['text' => self::DATA_TYPE_STR,
'id' => self::DATA_TYPE_INT,
'user_id' => self::DATA_TYPE_INT,
'time' => self::DATA_TYPE_INT];
}
class privateMessage extends message
{
protected static $schema=
['text' => self::DATA_TYPE_STR,
'id' => self::DATA_TYPE_INT,
'user_id' => self::DATA_TYPE_INT,
'time' => self::DATA_TYPE_INT,
'to_id' => self::DATA_TYPE_INT]; //this property i want to add it in this child
}