Skip to content

Commit

Permalink
feat: add IterableMapperInterface getter to the non-framework factory
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi committed Apr 29, 2024
1 parent c30d661 commit 0d63a35
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.2.0

* feat: add `IterableMapperInterface` for mapping iterables
* feat: add `IterableMapperInterface` getter to the non-framework factory

## 1.1.2

Expand Down
10 changes: 10 additions & 0 deletions src/MapperFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class MapperFactory
private ?ArrayLikeMetadataFactoryInterface $arrayLikeMetadataFactory = null;
private ?MainTransformerInterface $mainTransformer = null;
private ?MapperInterface $mapper = null;
private ?IterableMapperInterface $iterableMapper = null;
private ?MappingFactoryInterface $mappingFactory = null;
private ?ObjectCacheFactoryInterface $objectCacheFactory = null;
private ?SubMapperFactoryInterface $subMapperFactory = null;
Expand Down Expand Up @@ -227,6 +228,15 @@ public function getMapper(): MapperInterface
return $this->mapper;
}

public function getIterableMapper(): IterableMapperInterface
{
if (null === $this->iterableMapper) {
$this->iterableMapper = new Mapper($this->getMainTransformer());
}

return $this->iterableMapper;
}

//
// property info
//
Expand Down

0 comments on commit 0d63a35

Please sign in to comment.