protected function mapObjectToEntity(array $mapping, \stdClass $data, $entity)
    {
        foreach ($mapping as $dataProperty => $map) {
            if (property_exists($data, $dataProperty)) {
                if (is_string($map) || is_object($map) || is_int($map)) {
                    try {
                        $setter = $this->getEntitySetter($entity, $map);
                        if ($data->{$dataProperty}) {
                            // Inject data into entity
                            call_user_func([$entity, $setter], $data->{$dataProperty});
                        }
                    } catch (\LogicException $e) {
                        //no stter
                    }
                } else {
                    // Retrieve the entity setter

                    call_user_func($map, $entity, $data);
                }
            }
        }

        return $entity;
    }