-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from mark-gerarts/master
update local fork with latest changes from master
- Loading branch information
Showing
17 changed files
with
425 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/MappingOperation/Implementations/MapFromWithMapper.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Veaceslav Vasilache <[email protected]> | ||
* Date: 3/14/18 | ||
* Time: 1:16 PM | ||
*/ | ||
|
||
namespace AutoMapperPlus\MappingOperation\Implementations; | ||
|
||
use AutoMapperPlus\MappingOperation\MapperAwareOperation; | ||
use AutoMapperPlus\MappingOperation\MapperAwareTrait; | ||
|
||
/** | ||
* Class MapFromWithMapper | ||
* | ||
* @package AutoMapperPlus\MappingOperation\Implementations | ||
*/ | ||
class MapFromWithMapper extends MapFrom implements MapperAwareOperation | ||
{ | ||
use MapperAwareTrait; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
protected function getSourceValue($source, string $propertyName) | ||
{ | ||
return ($this->valueCallback)($source, $this->mapper); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace AutoMapperPlus\MappingOperation; | ||
|
||
use AutoMapperPlus\AutoMapperInterface; | ||
|
||
/** | ||
* Interface MapperAwareOperation | ||
* | ||
* @package AutoMapperPlus\MappingOperation | ||
*/ | ||
interface MapperAwareOperation { | ||
/** | ||
* @param AutoMapperInterface $mapper | ||
*/ | ||
public function setMapper(AutoMapperInterface $mapper): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace AutoMapperPlus\MappingOperation; | ||
|
||
use AutoMapperPlus\AutoMapperInterface; | ||
|
||
/** | ||
* Trait MapperAwareTrait | ||
* | ||
* @package AutoMapperPlus\MappingOperation | ||
*/ | ||
trait MapperAwareTrait | ||
{ | ||
/** | ||
* @var AutoMapperInterface | ||
*/ | ||
protected $mapper; | ||
|
||
/** | ||
* @param AutoMapperInterface $mapper | ||
*/ | ||
public function setMapper(AutoMapperInterface $mapper): void | ||
{ | ||
$this->mapper = $mapper; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.