cvs: phpdoc /kr/language oop.xml
| From: | WonHee Hwang | Date: | Wed, 10 Jan 2001 11:16:04 +0000 |
| Subject: | cvs: phpdoc /kr/language oop.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969333533@lists.php.net to get a copy of this message | ||
regina Wed Jan 10 03:16:04 2001 EDT
Modified files:
/phpdoc/kr/language oop.xml
Log:
Index: phpdoc/kr/language/oop.xml
diff -u phpdoc/kr/language/oop.xml:1.2 phpdoc/kr/language/oop.xml:1.3
--- phpdoc/kr/language/oop.xml:1.2 Tue Jan 9 16:41:17 2001
+++ phpdoc/kr/language/oop.xml Wed Jan 10 03:16:04 2001
@@ -1,11 +1,11 @@
- <chapter id="language.oop">
+ <chapter id="language.oop">
<title>Classes and Objects</title>
<sect1 id="keyword.class">
<title><literal>class</literal></title>
<para>
- A class is a collection of variables and functions working with
- these variables. A class is defined using the following syntax:
+ í´ëì¤ë ì¼ë ¨ì ë³ìì ì´ ë³ìë¤ì
ì¬ì©íë í¨ìë¤ì 모ìì´ë¤.
+ í´ëì¤ë ë¤ìê³¼ ê°ì ë°©ë²ì¼ë¡
ì ì¸íë¤
<informalexample>
<programlisting role="php">
@@ -36,18 +36,16 @@
</para>
<para>
- This defines a class named Cart that consists of an associative
- array of articles in the cart and two functions to add and remove
- items from this cart.
+ ì´ ì ì¸ì Cartë¼ë ì´ë¦ì í´ëì¤ë¡,
ì¹´í¸ìì ë¤ì´ìë 물íì ìí
+ í ê°ì ë°°ì´ ë³ìì cartì 물건ì
ë£ê±°ë ë¹¼ë ë ê°ì í¨ìë¡ êµ¬ì±ëì´
ìë¤.
</para>
<note><simpara>
In PHP 4, only constant initializers for <literal>var</literal>
variables are allowed. Use constructors for non-constant initializers.
</simpara></note>
<para>
- Classes are types, that is, they are blueprints for actual
- variables. You have to create a variable of the desired type with
- the new operator.
+ Classeë Typeì¼ë¡, ì¤ì ë³ìë¤ì
ì²ì¬ì§ì´ë¼ í ì ìë¤.
+ ì¬ë¬ë¶ì new ì°ì°ì를 ì¬ì©íì¬ ìíë
typeì ë³ì를 ìì±íì¬ì¼ íë¤.
</para>
<informalexample>
@@ -58,14 +56,17 @@
</informalexample>
<para>
- This creates an object $cart of the class Cart. The function
- add_item() of that object is being called to add 1 item of article
- number 10 to the cart. </para><para> Classes can be extensions of
- other classes. The extended or derived class has all variables and
- functions of the base class and what you add in the extended
- definition. This is done using the extends keyword. Multiple
- inheritance is not supported.
+ ìì ìë ìë Cart í´ëì¤ì $cartë¼ë
object를 ë§ëë ê²ì´ë¤.
+ ì´ objectì add_item() í¨ì를 í¸ì¶íì¬ ë¬¼í
ë²í¸ "10"ë²ì 물í 1ê°ë¥¼ ì¹´í¸ì
ë£ëë¤.
</para>
+ <para>
+ í´ëì¤ë ë¤ë¥¸ í´ëì¤ë¡ íì¥ ë ì
ìë¤.
+ íì¥ í¹ì íìë(extended or derived) í´ëì¤ë
baseê° ëë
+ í´ëì¤ì 모ë ë³ìë¤ê³¼ í¨ìë¤ì
ê·¸ëë¡ ê°ì§ê² ëê³ ,
+ ì¬ê¸°ì ì¶ê°ë¡ íì¥ë ì ì¸ì í ì
ìë¤.
+ ì´ë¥¼ ìí´ "extends"ë¼ë í¤ìëê°
ì¬ì©ëë¤.
+ ëê° ì´ìì ë¶ëª¨ í´ëì¤ë¥¼ ê°ì§ë
ë¤ì¤ìì(Multiple inheritance)ë ì§ìíì§ ìëë¤.
+ </para>
<informalexample>
<programlisting role="php">
@@ -80,11 +81,10 @@
</informalexample>
<para>
- This defines a class Named_Cart that has all variables and
- functions of Cart plus an additional variable $owner and an
- additional function set_owner(). You create a named cart the usual
- way and can now set and get the carts owner. You can still use
- normal cart functions on named carts:
+ ìì ìë Cart í´ëì¤ì ë³ìì í¨ìì
$owner ë³ìì set_owner() í¨ì를
+ ì¶ê°í Named_Cartë¼ë í´ëì¤ì ì ì¸ì´ë¤.
ì¬ë¬ë¶ì ì´ë¦ë¶ì ì¹´í¸(named cart)를
+ ì¬ì©íì¬ ì¹´í¸ì 주ì¸ì ì¤ì íê³
ì°¾ìë³¼ ì ìë¤.
+ ëí 기존ì ì¹´í¸(cart)ì ìë í¨ìë
모ë ì¬ì©í ì ìë¤.
</para>
<informalexample>
@@ -97,14 +97,12 @@
</informalexample>
<para>
- Within functions of a class the variable $this means this
- object. You have to use $this->something to access any variable or
- function named something within your current object.
+ í´ëì¤ ë´ë¶ì ìë í¨ììì $this ë¼ë
ë³ìë ì기 ìì object를 ì미íë¤.
+ $this->somethingì ííë¡ íì¬ objectì ë³ìë
í¨ì를 ì¬ì©íì¬ì¼ íë¤.
</para>
<para>
- Constructors are functions in a class that are automatically
- called when you create a new instance of a class. A function
- becomes a constructor when it has the same name as the class.
+ ìì±ì(Constructor)ë í´ë¹ í´ëì¤ì ì
ì¸ì¤í´ì¤(ìë¡ ë§ë ë³ìë¼ê³ ìê°í´
ëì)를
+ ë§ë¤ ë ìëì ì¼ë¡ ì¤íëë í¨ì를
ì미íë¤. í´ëì¤ì ì´ë¦ê³¼ ê°ì
ì´ë¦ì í¨ìê° ìì±ìê° ëë¤.
</para>
<informalexample>
@@ -118,11 +116,10 @@
</informalexample>
<para>
- This defines a class Auto_Cart that is a Cart plus a constructor
- which initializes the cart with one item of article number "10"
- each time a new Auto_Cart is being made with "new". Constructors
- can also take arguments and these arguments can be optional, which
- makes them much more useful.
+ ìì ìë Cart í´ëì¤ì 물íë²í¸ 10ë²ì
물íì í ê° ìëì¼ë¡ ì¶ê°íë
+ ìì±ì를 ì¶ê°í Auto_Cartë¼ë í´ëì¤ì
ì ì¸ì´ë¤. Auto_Cartë "new"ë¡ ìì±ëë¤.
+ ìì±ìë ëí ì¸ì(argument)를 ê°ì§ ì
ìê³ , ì´ ì¸ìë¤ì defaultê°ì ê°ì§
ìµì
ì¼ë¡ ì ì¸ í ì ìë¤.
+ ì´ ê¸°ë¥ì ì¤ì ë¡ ë§¤ì° ì ì©íë¤.
</para>
<informalexample>
@@ -145,8 +142,8 @@
<caution>
<simpara>
- For derived classes, the constructor of the parent class is not
- automatically called when the derived class's constructor is
+ íìë(derived) í´ëì¤ì ê²½ì°, ì´ í´ëì¤ì
ìì±ìê° í¸ì¶ë ë
+ ë¶ëª¨ í´ëì¤ì ìì±ìë ìëì¼ë¡
í¸ì¶ëì§ ìëë¤.
called.
</simpara>
</caution>