Controllers\xAPI\StatementIndexController::makeAttachmentsResult PHP Method

makeAttachmentsResult() private method

Makes an attachments result.
private makeAttachmentsResult ( array $statements, $count, array $opts ) : stdClass
$statements array
$opts array
return stdClass
    private function makeAttachmentsResult(array $statements, $count, array $opts)
    {
        $boundary = Helpers::MULTIPART_BOUNDARY;
        $eol = static::EOL;
        $this->emit("--{$boundary}{$eol}");
        $this->emit("Content-Type:application/json{$eol}{$eol}");
        $this->makeStatementsResult($statements, $count, $opts);
        $attachments = $this->statements->getAttachments($statements, $opts);
        foreach ($attachments as $attachment) {
            $this->emit("{$eol}--{$boundary}{$eol}" . 'Content-Type:' . $attachment->content_type . $eol . 'Content-Transfer-Encoding:binary' . $eol . 'X-Experience-API-Hash:' . $attachment->hash . $eol . $eol);
            while (!feof($attachment->content)) {
                $this->emit(fread($attachment->content, 8192));
            }
            fclose($attachment->content);
        }
        $this->emit("{$eol}--{$boundary}--");
    }