<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
	<channel>
				<title><![CDATA[KBContent 클래스의 initWithUID 함수가 정상 작동하지 않는 것 같습니다.]]></title>
		<link>https://www.cosmosfarm.com/threads/rss/document/19692</link>
		<description><![CDATA[<pre>
<code class="language-php">$this-&gt;initOptions();
$this-&gt;initAttachedFiles();</code></pre>

<p>현재 KBContent 클래스 내 initWithUID 함수에 있는 소스 중 일부분입니다.</p>

<p>현재 KBoard 소스를 활용하여 게시물 한 건에 대한 정보를 가져오는 소스를 짰었습니다.<br />
그런데 initWithUID 함수만 써도 옵션과 첨부파일 모두 가져올 수 있는 구조인 것 같습니다만,<br />
실제로 이 함수를 써보면 이 두 가지 정보를 가져오지 않습니다.<br />
저는 옵션과 첨부파일은 따로 가져와야 하는 줄 알고, 그렇게 짜다가 시간이 조금 남아서 이 부분을 분석해 봤습니다.</p>

<p>이 부분 확인해 보셔야 할 듯 싶네요.</p>

<pre>
<code class="language-json">{
	board_id: "6",
	category1: "",
	category2: "",
	comment: "0",
	content: "ㅂㅈㄷㄱ",
	date: "20180122230525",
	like: "0",
	member_display: "wpadm",
	member_uid: "1",
	notice: "",
	parent_uid: "0",
	password: "",
	search: "1",
	secret: "",
	status: "",
	thumbnail_file: "",
	thumbnail_name: "",
	title: "테스트",
	uid: "13",
	unlike: "0",
	update: "20180202014854",
	view: "9",
	vote: "0"
}</code></pre>

<p>이게 안내해 주셨던 대로 toArray 함수를 사용해서 가져온 결과입니다.<br />
option, attach 값이 빠져있죠?</p>
]]></description>
		<copyright>Copyright 2026, 코스모스팜</copyright>
				<item>
			<title><![CDATA[답변 감사합니다.

지금 코드 짜놓은 그대로 함수를 따로따로 실행시켜서 넣어줘야겠네요.
]]></title>
			<link>https://www.cosmosfarm.com/threads/document/19711</link>
			<description><![CDATA[<p>답변 감사합니다.</p>

<p>지금 코드 짜놓은 그대로 함수를 따로따로 실행시켜서 넣어줘야겠네요.</p>
]]></description>
			<author>ProTech</author>
			<pubDate>Fri, 02 Feb 2018 00:34:19 +0000</pubDate>
			<category>KBoard</category>
		</item>
				<item>
			<title><![CDATA[안녕하세요~^^

별다른 문제는 없어보입니다.

initWithUID 메소드 코드가 동작되고 있기 때문에 게시판...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/19697</link>
			<description><![CDATA[<p>안녕하세요~^^</p>

<p>별다른 문제는 없어보입니다.</p>

<p>initWithUID 메소드 코드가 동작되고 있기 때문에 게시판에서 &lt;?php echo $content-&gt;option-&gt;name?&gt; 이러한 코드가 동작할 수 있습니다.</p>

<p>실제 코드를 보시면 아시겠지만 $content-&gt;toArray() 이 메소드의 값을 출력하게 되면 kboard_board_content 테이블의 값만 출력됩니다.</p>

<p>kboard_board_option 테이블의 값을 함께 출력하지는 않습니다.</p>

<p>option, attach 값이 출력되지 않는건 가져오는 방법이 달라서 그렇습니다.</p>

<p>아래 예제 코드를 실행시켜 봐보세요~</p>

<pre>
<code>&lt;?php
print_r($content-&gt;toArray());
print_r($content-&gt;toArrayWithOptions());
print_r($content-&gt;option-&gt;toArray());
print_r(get_object_vars($content-&gt;attach));
?&gt;</code></pre>

<p>고맙습니다.</p>
]]></description>
			<author>스레드봇</author>
			<pubDate>Thu, 01 Feb 2018 12:31:23 +0000</pubDate>
			<category>KBoard</category>
		</item>
			</channel>
</rss>