for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Canvas\Contracts\Mapper;
trait RelationshipTrait
{
/**
* Attach relationship to DTO.
*/
protected function getRelationships(object $object, object $objectDto, array $relationships) : void
if (isset($relationships['relationships'])) {
foreach ($relationships['relationships'] as $relationship) {
$objectDto->$relationship = $object->$relationship;
}