関数・クラス解説

SDO_DAS_Relational::applyChanges

version:^ (公式)

Applies the changes made to a data graph back to the database

公式リファレンス

書式

SDO_DAS_Relational::applyChanges ( PDO $database_handle , SDODataObject $root_data_object ) : void

説明

警告

この関数は、実験的 なものです。この関数の動作・名前・その他ドキュメントに書かれている事項は、予告なく、将来的な PHPのリリースにおいて変更される可能性があります。この関数は自己責任で使用してください。

Given a PDO database handle and the special root object of a data graph, examine the change summary in the datagraph and applies the changes to the database. The changes that it can apply can be creations of data objects, deletes of data objects, and modifications to properties of data objects.

パラメータ

PDO_database_handle
Constructed using the PDO extension. A typical line to construct a PDO database handle might look like this:
$dbh = new PDO("mysql:dbname=COMPANYDB;host=localhost",DATABASE_USER,DATABASE_PASSWORD);
root_data_object
The special root object which is at the top of every SDO data graph.

返値

None. Note however that the datagraph that was passed is still intact and usable. Furthermore, if data objects were created and written back to a table with autogenerated primary keys, then those primary keys will now be set in the data objects. If the changes were successfully written, then the change summary associated with the datagraph will have been cleared, so that it is possible to now make further changes to the data graph and apply those changes in turn. In this way it is possible to work with the same data graph and apply changes repeatedly.

エラー

SDO_DAS_Relational::applyChanges() can throw an SDO_DAS_Relational_Exception if it is unable to apply all the changes correctly. The Relational DAS starts a database transaction before beginning to apply the changes and will commit the transaction only if they are all successful. The Relational DAS generates qualified update and delete statements which contain a where clause that specifies that the row to be updated or deleted must contain the same values that it did when the data was first retrieved. This is how the optimistic concurrency is implemented. If any of the qualified update or delete statements fails to update or delete their target row, it may be because the data has been altered in the database in the meantime. In any event, if any update fails for any reason, the transaction is rolled back and an exception thrown. The exception will contain the generated SQL statement that failed. The Relational DAS also catches any PDO exceptions and obtains PDO diagnostic information which it includes in an SDO_DAS_Relational_Exception which it then throws.

注意

警告この関数は、実験的 なものです。この関数の動作・名前・その他ドキュメントに書かれている事項は、予告なく、将来的な PHPのリリースにおいて変更される可能性があります。この関数は自己責任で使用してください。

サンプル

Please see the Examples section in the general information about the Relational DAS for many examples of calling this method. Please see also the section on Tracing to see how you can see what SQL statements are generated by the Relational DAS.

ワード検索


※入力キーワードが、関数名・説明文・タグに含まれるものを検索

関数名アルファベット別

A B C D E F G H I J
K L M N O P Q R S T
U V W X Y Z _

最終更新一覧

stristr
 大文字小文字を区別せず文字列を検索し、ヒット箇所以降(あるいは以前)の文字列を返却

stripslashes
 バックスラッシュでエスケープされた文字列から、バックスラッシュを取り除く

stripos
 大文字小文字を区別せずに文字列が最初に現れる位置を取得する

stripcslashes
 addcslashes() でクォートされた文字列をアンクォートする

strip_tags
 文字列から HTML と PHP のタグを除去して返却

strcspn
 指定した文字が最初に現れる位置を調べる

strcoll
 ロケールに基づいて2つの文字列を比較し同じか(あるいは大小)を判定する

strcmp
 2つの文字列を比較し同じか(あるいは大小)を判定する

strchr
 strstr() のエイリアス

strcasecmp
 2つの文字列を比較(大文字小文字を区別せず同じとみなす)

カテゴリー一覧

PHP の振る舞いの変更
音声フォーマットの操作
認証サービス
コマンドライン関連
圧縮およびアーカイブ
暗号
データベース関連
日付および時刻関連
ファイルシステム
自然言語および文字エンコーディング
画像処理および作成
メール関連
数学
テキスト以外の MIME 型
プロセス制御
その他の基本モジュール
その他のサービス
検索エンジン用の拡張モジュール
サーバー固有のモジュール
セッション関連
テキスト処理
変数・データ型関連
ウェブサービス
Windows 用のモジュール
XML 操作
GUI用の拡張モジュール