| @@ 39-100 (lines=62) @@ | ||
| 36 | * @link https://github.com/techdivision/import-configuration-jms |
|
| 37 | * @link http://www.techdivision.com |
|
| 38 | */ |
|
| 39 | class ExportAdapter implements ExportAdapterConfigurationInterface |
|
| 40 | { |
|
| 41 | ||
| 42 | /** |
|
| 43 | * Trait that provides CSV configuration functionality. |
|
| 44 | * |
|
| 45 | * @var \TechDivision\Import\Configuration\Jms\CsvTrait |
|
| 46 | */ |
|
| 47 | use CsvTrait; |
|
| 48 | ||
| 49 | /** |
|
| 50 | * The export adapter's unique DI identifier. |
|
| 51 | * |
|
| 52 | * @var string |
|
| 53 | * @Type("string") |
|
| 54 | */ |
|
| 55 | protected $id = DependencyInjectionKeys::IMPORT_ADAPTER_EXPORT_CSV_FACTORY; |
|
| 56 | ||
| 57 | /** |
|
| 58 | * The filesystem adapter configuration instance. |
|
| 59 | * |
|
| 60 | * @var \TechDivision\Import\Configuration\Subject\SerializerConfigurationInterface |
|
| 61 | * @Type("TechDivision\Import\Configuration\Jms\Configuration\Subject\Serializer") |
|
| 62 | * @SerializedName("serializer") |
|
| 63 | */ |
|
| 64 | protected $serializer; |
|
| 65 | ||
| 66 | /** |
|
| 67 | * Return's the export adapter's unique DI identifier |
|
| 68 | * |
|
| 69 | * @return string The export adapter's unique DI identifier |
|
| 70 | */ |
|
| 71 | public function getId() |
|
| 72 | { |
|
| 73 | return $this->id; |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * Return's the serializer configuration instance. |
|
| 78 | * |
|
| 79 | * @return \TechDivision\Import\Configuration\Subject\SerializerConfigurationInterface The serializer configuration instance |
|
| 80 | */ |
|
| 81 | public function getSerializer() |
|
| 82 | { |
|
| 83 | return $this->serializer; |
|
| 84 | } |
|
| 85 | ||
| 86 | /** |
|
| 87 | * Lifecycle callback that will be invoked after deserialization. |
|
| 88 | * |
|
| 89 | * @return void |
|
| 90 | * @PostDeserialize |
|
| 91 | */ |
|
| 92 | public function postDeserialize() |
|
| 93 | { |
|
| 94 | ||
| 95 | // set a default serializer if none has been configured |
|
| 96 | if ($this->serializer === null) { |
|
| 97 | $this->serializer = new Serializer(); |
|
| 98 | } |
|
| 99 | } |
|
| 100 | } |
|
| 101 | ||
| @@ 39-100 (lines=62) @@ | ||
| 36 | * @link https://github.com/techdivision/import-configuration-jms |
|
| 37 | * @link http://www.techdivision.com |
|
| 38 | */ |
|
| 39 | class ImportAdapter implements ImportAdapterConfigurationInterface |
|
| 40 | { |
|
| 41 | ||
| 42 | /** |
|
| 43 | * Trait that provides CSV configuration functionality. |
|
| 44 | * |
|
| 45 | * @var \TechDivision\Import\Configuration\Jms\CsvTrait |
|
| 46 | */ |
|
| 47 | use CsvTrait; |
|
| 48 | ||
| 49 | /** |
|
| 50 | * The import adapter's unique DI identifier. |
|
| 51 | * |
|
| 52 | * @var string |
|
| 53 | * @Type("string") |
|
| 54 | */ |
|
| 55 | protected $id = DependencyInjectionKeys::IMPORT_ADAPTER_IMPORT_CSV_FACTORY; |
|
| 56 | ||
| 57 | /** |
|
| 58 | * The filesystem adapter configuration instance. |
|
| 59 | * |
|
| 60 | * @var \TechDivision\Import\Configuration\Subject\SerializerConfigurationInterface |
|
| 61 | * @Type("TechDivision\Import\Configuration\Jms\Configuration\Subject\Serializer") |
|
| 62 | * @SerializedName("serializer") |
|
| 63 | */ |
|
| 64 | protected $serializer; |
|
| 65 | ||
| 66 | /** |
|
| 67 | * Return's the import adapter's unique DI identifier |
|
| 68 | * |
|
| 69 | * @return string The import adapter's unique DI identifier |
|
| 70 | */ |
|
| 71 | public function getId() |
|
| 72 | { |
|
| 73 | return $this->id; |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * Return's the serializer configuration instance. |
|
| 78 | * |
|
| 79 | * @return \TechDivision\Import\Configuration\Subject\SerializerConfigurationInterface The serializer configuration instance |
|
| 80 | */ |
|
| 81 | public function getSerializer() |
|
| 82 | { |
|
| 83 | return $this->serializer; |
|
| 84 | } |
|
| 85 | ||
| 86 | /** |
|
| 87 | * Lifecycle callback that will be invoked after deserialization. |
|
| 88 | * |
|
| 89 | * @return void |
|
| 90 | * @PostDeserialize |
|
| 91 | */ |
|
| 92 | public function postDeserialize() |
|
| 93 | { |
|
| 94 | ||
| 95 | // set a default serializer if none has been configured |
|
| 96 | if ($this->serializer === null) { |
|
| 97 | $this->serializer = new Serializer(); |
|
| 98 | } |
|
| 99 | } |
|
| 100 | } |
|
| 101 | ||