public function __construct($data = null, $readOnly = false) { if ($data !== null) { $this->copyFrom($data); } $this->setReadOnly($readOnly); }