我的所有实体都扩展了一个具有Customer createdByandString createdById字段的基本实体,还有一些具有相同功能的实体。我想Customer在传输数据时排除整个对象。
其他一些实体扩展了另一个实体,该实体本身扩展了基本实体,因此有以下映射器:
@MapperConfig(componentModel = "spring", mappingInheritanceStrategy = MappingInheritanceStrategy.AUTO_INHERIT_FROM_CONFIG)
public interface AuditingEntityMapper<Dto, Entity> {
@Mapping(target = "createdBy", source = "createdById")
@Mapping(target = "lastModifiedBy", source = "lastModifiedById")
Dto toDto(Entity entity);
@Mapping(target = "createdBy", ignore = true)
@Mapping(target = "lastModifiedBy", ignore = true)
Entity toEntity(Dto dto);
}
@MapperConfig(componentModel = "spring", mappingInheritanceStrategy = MappingInheritanceStrategy.AUTO_INHERIT_FROM_CONFIG)
public interface ManageableEntityMapper<ManageableDtoType extends ManageableDTO, ManageableType extends Manageable> {
ManageableDtoType toDto(ManageableType manageable);
@Mapping(target = "project", ignore = true)
ManageableType toEntity(ManageableDtoType dto);
} …Run Code Online (Sandbox Code Playgroud) 我试图弄清楚 PHP 如何解释 foreach 语句。这导致我gdb在执行虚拟 foreach 脚本时使用。
我最终在zend_compile_foreach()函数中的 zend_compile.c 中。我看到对宏 ZEND_FE_FETCH_R 的调用移动了我们循环的数组/对象的内部指针。
有几件事我不明白:
zend_compile_foreach上下文zend_compile_stmt(因此zend_compile_foreach)以进行迭代?那么代码编译 N 次了吗?N 是数组/对象中的元素数