[Serializer] CsvEncoder::AS_COLLECTION_KEY constant
This commit is contained in:
parent
e32b9650cb
commit
660a456d6f
@ -28,6 +28,7 @@ class CsvEncoder implements EncoderInterface, DecoderInterface
|
||||
const KEY_SEPARATOR_KEY = 'csv_key_separator';
|
||||
const HEADERS_KEY = 'csv_headers';
|
||||
const ESCAPE_FORMULAS_KEY = 'csv_escape_formulas';
|
||||
const AS_COLLECTION_KEY = 'as_collection';
|
||||
|
||||
private $delimiter;
|
||||
private $enclosure;
|
||||
@ -157,7 +158,7 @@ class CsvEncoder implements EncoderInterface, DecoderInterface
|
||||
}
|
||||
fclose($handle);
|
||||
|
||||
if ($context['as_collection'] ?? false) {
|
||||
if ($context[self::AS_COLLECTION_KEY] ?? false) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -324,7 +324,7 @@ foo
|
||||
a
|
||||
|
||||
CSV
|
||||
, 'csv', array('as_collection' => true)));
|
||||
, 'csv', array(CsvEncoder::AS_COLLECTION_KEY => true)));
|
||||
}
|
||||
|
||||
public function testDecodeToManyRelation()
|
||||
|
Reference in New Issue
Block a user