1

Hello

I had defined an array as static property in parent

In the child the same array is needed but i need another value in this array

I redefine the array and override the parent's array

The question:

Is there another way to add new value in the array without redefining it ?

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

    }
Mustafa Agamey
  • 513
  • 2
  • 9
  • 21

0 Answers0