addType('id','integer'); $this->addType('taskId','integer'); $this->addType('beforeFileExists','boolean'); $this->addType('beforeSize','integer'); $this->addType('currentFileExists','boolean'); $this->addType('currentSize','integer'); } public function jsonSerialize() { return [ 'id' => $this->id, 'taskId' => $this->taskId, 'type' => $this->type, 'before' => [ 'fileExists' => $this->beforeFileExists, 'path' => $this->beforePath, 'size' => $this->beforeSize, ], 'current' => [ 'fileExists' => $this->currentFileExists, 'path' => $this->currentPath, 'size' => $this->currentSize, ] ]; } }