4D v17.4

entity.touchedAttributes( )

ホーム

 
4D v17.4
entity.touchedAttributes( )

entity.touchedAttributes( )  


 

説明  

entity.touchedAttributes( ) メソッドは、エンティティがメモリに読み込まれた時点から変更された属性の名前を返します。

これはストレージあるいはリレートエンティティ型の属性に適用されます(dataClassAttribute.kind 参照)。

リレートされたエンティティが触れられていた場合(例: 外部キーなど)、リレートされたエンティティとそのプライマリーキーの名前が返されます。

どのエンティティ属性も触れられていなかった場合、メソッドは空のコレクションを返します。

 C_COLLECTION($touchedAttributes)
 <p>C_OBJECT($emp)
 
 $touchedAttributes:=New collection
 $emp:=ds.Employee.get(725)
 $emp.firstName:=$emp.firstName //同じで値で更新されていた場合でも、属性は触れられていたとマークされます
 $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"]

この場合において:

  • firstName および lastName はストレージ型です
  • employer はリレートエンティティ型です
  • employerID は、employer リレートエンティティの外部キーです



参照 

entity.touched( )

 
プロパティ 

プロダクト: 4D
テーマ: ORDA - エンティティ

 
ページの目次 
 
履歴 

 
ARTICLE USAGE

ランゲージリファレンス ( 4D v17)
ランゲージリファレンス ( 4D v17.1)
ランゲージリファレンス ( 4D v17.2)
ランゲージリファレンス ( 4D v17.3)
ランゲージリファレンス ( 4D v17.4)