Vous êtes sur le site Web historique de la documentation de 4D. Les documentations sont progressivement déplacées vers developer.4d.com

Accueil

 
4D v19.8
entity.touchedAttributes( )

entity.touchedAttributes( ) 


 

entity.touchedAttributes -> Résultat 
Paramètre Type   Description
Résultat  Collection in Noms des attributs touchés ou collection vide

La méthode entity.touchedAttributes( ) retourne les noms des attributs qui ont été modifiés depuis que l'entité a été chargée en mémoire.

Cette fonction est applicable aux attributs de type storage ou relatedEntity (voir dataClassAttribute.kind).

Dans le cas d'un attribut relationnel ayant été "touché" (i.e., la clé étrangère), le nom de l'entité liée et celui de sa clé primaire sont retournés.

Si aucun attribut de l'entité n'a été touché, la méthode retourne une collection vide.

 C_COLLECTION($touchedAttributes)
 C_OBJET($emp)
 
 $touchedAttributes:=Creer collection
 $emp:=ds.Employee.get(725)
 $emp.firstName:=$emp.firstName //Même modifié avec la même valeur, l'attribut est considéré comme touché
 $emp.lastName:="Martin"
 $touchedAttributes:=$emp.touchedAttributes()
  //$touchedAttributes: ["firstName","lastName"]

 C_COLLECTION($touchedAttributes)
 C_OBJET($emp;$company)
 
 $touchedAttributes:=Creer 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"]

Dans ce cas :

  • le "kind" de firstName et lastName est storage
  • le "kind" de employer est relatedEntity
  • employerID est la clé étrangère de l'entité liée employer.



Voir aussi  

entity.touched( )

 
PROPRIÉTÉS 

Produit : 4D
Thème : ORDA - Entity
Nom intl. : entity.touchedAttributes( )

 
PAGE CONTENTS 
 
HISTORIQUE 

Créé : 4D v17

 
UTILISATION DE L'ARTICLE

4D - Langage ( 4D v19)
4D - Langage ( 4D v19.1)
4D - Langage ( 4D v19.4)
4D - Langage ( 4D v19.5)
4D - Langage ( 4D v19.6)
4D - Langage ( 4D v19.7)
4D - Langage ( 4D v19.8)