Created
June 20, 2018 10:13
-
-
Save lilobase/0a5af573c97e56349c9ab1e0fc3885d9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
namespace App\Membership\Infrastructure\Doctrine; | |
use App\Membership\Domain\Membership; | |
trait MembershipObjectMapper | |
{ | |
static function fromDoctrine(MembershipDoctrineEntity $entity): Membership | |
{ | |
$instance = new self(); | |
$instance->field = $entity->field; | |
return $instance; | |
} | |
static function fromDomain(Membership $entity): MembershipDoctrineEntity | |
{ | |
$instance = new self(); | |
$instance->field = $entity->field(); | |
return $instance; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment