Este é o site histórico da documentação 4D. As documentações estão sendo movidas progressivamente para developer.4d.com

Página Inicial

 
4D v19.8
entity.touchedAttributes( )

entity.touchedAttributes( ) 


 

entity.touchedAttributes -> Resultado 
Parâmetro Tipo   Descrição
Resultado  Collection in Names of touched attributes, or empty collection

The entity.touchedAttributes( ) method returns the names of the attributes that have been modified since the entity was loaded into memory.

This applies for attributes of the type storage or relatedEntity (see dataClassAttribute.kind).

In the case of a related entity having been touched (i.e., the foreign key), the name of the related entity and its primary key's name are returned.

If no entity attribute has been touched, the method returns an empty collection.

 C_COLLECTION($touchedAttributes)
 C_OBJECT($emp)
 
 $touchedAttributes:=New collection
 $emp:=ds.Employee.get(725)
 $emp.firstName:=$emp.firstName //Even if updated with the same value, the attribute is marked as touched
 $emp.lastName:="Martin"
 $touchedAttributes:=$emp.touchedAttributes()
  //$touchedAttributes: ["firstName","lastName"]

 C_COLLECTION($touchedAttributes)
 C_OBJECT($emp;$company)
 
 $touchedAttributes:=New collection
 
 $emp:=ds.Employee.get(672)
 $emp.firstName:=$emp.firstName
 $emp.lastName:="Martin"
 
 $company:=ds.Company.get(121)
 $emp.employer:=$company
 
 $touchedAttributes:=$emp.touchedAttributes()
 
  //collection $touchedAttributes: ["firstName","lastName","employer","employerID"]

In this case:

  • firstName and lastName have a storage kind
  • employer has a relatedEntity kind
  • employerID is the foreign key of the employer related entity



Ver também 

entity.touched( )

 
PROPRIEDADES 

Produto: 4D
Tema: ORDA - Entidade

 
CONTEÚDO DA PÁGINA 
 
HISTÓRIA 

Criado por: 4D v17

 
ARTICLE USAGE

Manual de linguagem 4D ( 4D v19)
Manual de linguagem 4D ( 4D v19.1)
Manual de linguagem 4D ( 4D v19.4)
Manual de linguagem 4D ( 4D v19.5)
Manual de linguagem 4D ( 4D v19.6)
Manual de linguagem 4D ( 4D v19.7)
Manual de linguagem 4D ( 4D v19.8)