ここは旧式の4DドキュメントWebサイトです。最新のアップデートされたドキュメントを読むには新サイトをご利用下さい→ developer.4d.com

ホーム

 
4D v19.8
entity.touchedAttributes( )

entity.touchedAttributes( ) 


 

entity.touchedAttributes -> 戻り値 
引数   説明
戻り値  コレクション in 触れられた属性の名前、あるいは空のコレクション

説明   

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 - エンティティ

 
ページの目次 
 
履歴 

初出: 4D v17

 
ARTICLE USAGE

ランゲージリファレンス ( 4D v19)
ランゲージリファレンス ( 4D v19.1)
ランゲージリファレンス ( 4D v19.4)
ランゲージリファレンス ( 4D v19.5)
ランゲージリファレンス ( 4D v19.6)
ランゲージリファレンス ( 4D v19.7)
ランゲージリファレンス ( 4D v19.8)