Procházet zdrojové kódy

sync Japanese document with r16772.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@16787 44c647ce-9c0f-0410-b52a-842ac1e357ba
takagi před 16 roky
rodič
revize
b97bf008c2

+ 4 - 1
documentation/manual/ja/manual.xml.in

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Reviewed: no -->
-<!-- EN-Revision: 16771 -->
+<!-- EN-Revision: 16772 -->
 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
     "@DOCBOOK_DTD@"
 [
@@ -175,6 +175,9 @@
         <xi:include href="module_specs/Zend_Db_Table_Row.xml" />
         <xi:include href="module_specs/Zend_Db_Table_Rowset.xml" />
         <xi:include href="module_specs/Zend_Db_Table-Relationships.xml" />
+        <xi:include href="module_specs/Zend_Db_Table_Definition.xml">
+            <xi:fallback><xi:include href="../en/module_specs/Zend_Db_Table_Definition.xml" /></xi:fallback>
+        </xi:include>
     </chapter>
 
     <chapter id="zend.debug">

+ 52 - 8
documentation/manual/ja/module_specs/Zend_Db_Table.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Reviewed: no -->
-<!-- EN-Revision: 15851 -->
+<!-- EN-Revision: 16772 -->
 <sect1 id="zend.db.table">
 
     <title>Zend_Db_Table</title>
@@ -26,6 +26,36 @@
 
     </sect2>
 
+    <sect2 id="zend.db.table.concrete">
+        <title>Zend_Db_Table を具象クラスとして使用する方法</title>
+        
+        <para>
+            ZF 1.9 以降では、Zend_Db_Table のインスタンスを作成することができます。
+            つまり、一つのテーブルに対して select、insert、update、delete
+            などといった単純な操作を行うためだけにわざわざ基底クラスを継承して設定する必要がなくなるということです。
+            以下に、もっとも単純な使用例を示します。
+        </para>
+        
+        <example id="zend.db.table.defining.concrete-instantiation.example1">
+
+            <title>文字列で名前を指定するだけのテーブルクラスの宣言</title>
+        
+                <programlisting language="php"><![CDATA[
+Zend_Db_Table::setDefaultAdapter($dbAdapter);
+$bugTable = new Zend_Db_Table('bug');
+]]></programlisting>
+
+        </example>
+        
+        <para>
+            これが、もっとも単純な使用例です。
+            以下で説明する Zend_Db_Table のオプションはまったく設定していません。
+            具象クラスの使用例に加えてより複雑なリレーション機能を使いたくなったときは
+            Zend_Db_Table_Definition のドキュメントを参照ください。
+        </para>
+        
+    </sect2>
+
     <sect2 id="zend.db.table.defining">
 
         <title>テーブルクラスの定義</title>
@@ -862,15 +892,29 @@ $rows = $table->find(array(1234, 5678), array('ABC', 'DEF'));
 
                         <programlisting language="php"><![CDATA[
 // 行セットを取得します
-$rows = $table->fetchAll('bug_status = "NEW"', 'bug_id ASC', 10, 0);
-$rows = $table->fetchAll($table->select()->where('bug_status = ?', 'NEW')
-                                         ->order('bug_id ASC')
-                                         ->limit(10, 0));
+$rows = $table->fetchAll(
+    'bug_status = "NEW"',
+    'bug_id ASC',
+    10,
+    0
+    );
+$rows = $table->fetchAll(
+    $table->select()
+        ->where('bug_status = ?', 'NEW')
+        ->order('bug_id ASC')
+        ->limit(10, 0)
+    );
 
 // 単一の行を取得します
-$row = $table->fetchRow('bug_status = "NEW"', 'bug_id ASC');
-$row = $table->fetchRow($table->select()->where('bug_status = ?', 'NEW')
-                                        ->order('bug_id ASC'));
+$row = $table->fetchRow(
+    'bug_status = "NEW"', 
+    'bug_id ASC'
+    );
+$row = $table->fetchRow(
+    $table->select()
+        ->where('bug_status = ?', 'NEW')
+        ->order('bug_id ASC')
+    );
 ]]></programlisting>
 
                     </para>