在PHP中为setter方法赋值

I have this class which let's me change the private data property using the setData method:

abstract class FooBase{

  public function __set($name, $value){
    $setter = 'set'.ucfirst($name);
    if(method_exists($this, $setter)) return $this->$setter($value);
    throw new Exception("Property {$setter} is not defined.");
  }

}

class Foo extends FooBase{

  static $instance;
  private $data;

  public static function app(){
    if(!(self::$instance instanceof self)){
      self::$instance = new self();
      self::app()->data = array('a' => 'somedata', 'b' => 'moredata');
    }
    return self::$instance;
  }

  public function setData($newdata){
    $this->data = $newdata;
  }
}

So to change it I call it like:

Foo::app()->data = array('a' => 'newdata', 'b' => 'morenewdata');

I was wondering if it's possible to somehow change only one array value from $data, like:

Foo::app()->data['a'] = 'newdata'; // <-- this doesn't work, but it's what I would like to do...

You could do this if data was public instead of private. Private means only the object can get that value internally. Public would allow you to do this. Either that or create a method to do what you want, as this could access the array internally, leaving data private.