svn: /phpdoc/kr/trunk/language/oop5/ properties.xml

[email protected] (Yu Ilho)
Newsgroups php.doc.kr
Message-ID <[email protected]>
acidd15                                  Sun, 28 Dec 2014 12:37:11 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=335420

Log:
initial translate

Changed paths:
    A   phpdoc/kr/trunk/language/oop5/properties.xml

Added: phpdoc/kr/trunk/language/oop5/properties.xml
===================================================================
--- phpdoc/kr/trunk/language/oop5/properties.xml	                        (rev 0)
+++ phpdoc/kr/trunk/language/oop5/properties.xml	2014-12-28 12:37:11 UTC (rev 335420)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+<!-- EN-Revision: 328167 Maintainer: acidd15 Status: ready -->
+<!-- Reviewed: no -->
+
+ <sect1 xml:id="language.oop5.properties" xmlns="http://docbook.org/ns/docbook">
+  <title>프로퍼티</title>
+
+  <para>
+   클래스 멤버 변수들을 "프로퍼티(properties)" 라고 부릅니다.
+   "애튜리뷰트(attributes)" 나 "필드(fields)" 라는 이름으로 불렀을지 모르지만, 이 문서에서는 "프로퍼티"를 사용하도록 하겠습니다.
+   프로퍼티는 <literal>public</literal>, <literal>protected</literal>,
+   또는 <literal>private</literal> 키워드를 붙일수 있으며, 이어 일반적인 변수선언이 뒤따릅니다.
+   선언시에 변수를 초기화 할수 있지만 반드시 상수여야 합니다.-- 이것은, 컴파일 타임에 평가 가능한 값이어야 함을 의미합니다.
+  </para>
+  <para>
+   <literal>public</literal>, <literal>protected</literal>,
+   와 <literal>private</literal> 의 의미에 대한 정보는 <xref linkend="language.oop5.visibility" /> 를 참고 하시기 바랍니다..
+  </para>
+  <note>
+   <para>
+    PHP 4 와의 하위 호환성을 유지하기 위해, PHP 5 는 아직도
+    프로퍼티를 선언할때 <literal>public</literal>, <literal>protected</literal>,
+    또는 <literal>private</literal> 키워드를 사용하는 방법과 함께 <literal>var</literal> 키워드를 사용하는것을 허용하고 있습니다.
+    그렇긴 하지만, <literal>var</literal> 키워드는 더이상 필수가 아니므로 사용에 제한을 둘것을 권장합니다.
+    PHP 5.0 에서 5.1.3 까지는 <literal>var</literal> 키워드는 비추천 으로
+    간주되어 <constant>E_STRICT</constant> 경고를 발생했습니다.
+    하지만, PHP 5.1.3 이후로는 더이상 비추천이 아니며, 경고도 발생하지 않습니다.
+   </para>
+   <para>
+    <literal>public</literal>, <literal>protected</literal>,
+    또는 <literal>private</literal> 중의 하나 대신에 <literal>var</literal> 키워드로 프로퍼티를 선언했다면,
+    PHP 5 는 <literal>public</literal> 으로 선언한것으로 다루게 됩니다.
+   </para>
+  </note>
+  <para>
+   클래스 메서드 내에서 비정적 프로퍼티는 <literal>-&gt;</literal> (객체 연산자) 를 사용하여 접근 가능합니다: <varname>$this-&gt;property</varname>
+   (여기서 <literal>property</literal> 는 프로퍼티명을 의미함).
+   정적 프로퍼티들은 <literal>::</literal> (Double Colon) 을 사용하여 접근 가능합니다:<varname>self::$property</varname>.
+   정적, 비정적 프로퍼티의 차이점을 알고 싶을 경우 <link linkend="language.oop5.static">스태틱 키워드</link> 를 참고 하시기 바랍니다.
+  </para>
+  <para>
+   의사-변수 <varname>$this</varname> 는 객체 내부에서 메서드가 호출되었을때 어떤 클래스의 내부에서든지 존재하는 값입니다.
+   <varname>$this</varname> 는 현재 호출한 객체를 참조합니다.(보통은 메서드가 속한 객체를 참조하지만, 만약에 메서드가 다른객체로부터
+   <link linkend="language.oop5.static">정적으로</link> 호출되었다면 다른 객체를 참조하는것도 가능합니다.)
+  </para>
+
+  <para>
+   <example>
+    <title>프로퍼티 선언</title>
+    <programlisting role="php">
+<![CDATA[
+<?php
+class SimpleClass
+{
+   // 잘못된 프로퍼티 선언:
+   public $var1 = 'hello ' . 'world';
+   public $var2 = <<<EOD
+hello world
+EOD;
+   public $var3 = 1+2;
+   public $var4 = self::myStaticMethod();
+   public $var5 = $myVar;
+
+   // 유효한 프로퍼티 선언:
+   public $var6 = myConstant;
+   public $var7 = array(true, false);
+
+   // PHP 5.3.0 이후부터 가능합니다.
+   public $var8 = <<<'EOD'
+hello world
+EOD;
+}
+?>
+]]>
+    </programlisting>
+   </example>
+  </para>
+
+  <note>
+   <para>
+    클래스와 객체를 다루는 몇가지 좋은 함수들이 존재 합니다.
+    원한다면 참고 하시기 바랍니다. <link linkend="ref.classobj">클래스/객체 함수들</link>.
+   </para>
+  </note>
+
+  <para>
+   <link linkend="language.types.string.syntax.heredoc">heredocs</link> 과는 다르게,
+   <link linkend="language.types.string.syntax.nowdoc">nowdocs</link> 은
+   어떤 정적 데이터 컨텍스트이든지 사용할 수 있으며, 프로퍼티도 그중하나 입니다.
+   <example>
+    <title>nowdoc을 이용한 프로퍼티 초기화 예제</title>
+    <programlisting role="php">
+<![CDATA[
+<?php
+class foo {
+   // As of PHP 5.3.0
+   public $bar = <<<'EOT'
+bar
+EOT;
+}
+?>
+]]>
+    </programlisting>
+   </example>
+  </para>
+  <note>
+   <para>
+    PHP 5.3.0 이후부터 nowdoc지원이 추가 되었습니다.
+   </para>
+  </note>
+ </sect1>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+indent-tabs-mode:nil
+sgml-parent-document:nil
+sgml-default-dtd-file:"~/.phpdoc/manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: syn=xml fen fdm=syntax fdl=2 si
+vim: et tw=78 syn=sgml
+vi: ts=1 sw=1
+-->


Property changes on: phpdoc/kr/trunk/language/oop5/properties.xml
___________________________________________________________________
Added: svn:keywords
   + Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
Added: svn:eol-style
   + native
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.