<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forum CakePHP.org.pl - Przetwarzanie danych]]></title>
	<link rel="self" href="http://forum.cakephp.org.pl/feed/atom/topic/88/"/>
	<updated>2009-08-01T16:43:53Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.cakephp.org.pl/topic/88/przetwarzanie-danych/</id>
		<entry>
			<title type="html"><![CDATA[Odp: Przetwarzanie danych]]></title>
			<link rel="alternate" href="http://forum.cakephp.org.pl/post/428/#p428"/>
			<content type="html"><![CDATA[<p>ok, mój problem spowodowany był błędem na stronie CakePHP, a w zasadzie drobną różnicą.</p><p>wg. API powinno być:<br /></p><div class="codebox"><pre><code>bindTranslation( $model, $fields, $reset = true )</code></pre></div><p>tymczasem u mnie dziala tak:<br /></p><div class="codebox"><pre><code>bindTranslation($fields, $reset)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[gaw]]></name>
				<uri>http://forum.cakephp.org.pl/user/95/</uri>
			</author>
			<updated>2009-08-01T16:43:53Z</updated>
			<id>http://forum.cakephp.org.pl/post/428/#p428</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Przetwarzanie danych]]></title>
			<link rel="alternate" href="http://forum.cakephp.org.pl/post/427/#p427"/>
			<content type="html"><![CDATA[<p>nie w tym rzecz.</p><p>problem lezy w tym, ze odczytuje tylko nazwe.<br /></p><div class="codebox"><pre><code>        [field] =&gt; name
                            [content] =&gt; nazwa produktu po polsku</code></pre></div><p>brakuje description i url.</p><p>teraz zapytanie dla tabeli i28n wyglada tak<br /></p><div class="codebox"><pre><code>SELECT `ProductsDescriptions`.`id`, `ProductsDescriptions`.`locale`, `ProductsDescriptions`.`model`, `ProductsDescriptions`.`foreign_key`, `ProductsDescriptions`.`field`, `ProductsDescriptions`.`content` FROM `mayer_i18n` AS `ProductsDescriptions` WHERE `model` = &#039;Product&#039; AND `field` = &#039;name&#039; AND `ProductsDescriptions`.`foreign_key` = (22)</code></pre></div><p>nie potrzebne jest to `field` = &#039;name&#039;</p>]]></content>
			<author>
				<name><![CDATA[gaw]]></name>
				<uri>http://forum.cakephp.org.pl/user/95/</uri>
			</author>
			<updated>2009-08-01T16:25:17Z</updated>
			<id>http://forum.cakephp.org.pl/post/427/#p427</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Przetwarzanie danych]]></title>
			<link rel="alternate" href="http://forum.cakephp.org.pl/post/426/#p426"/>
			<content type="html"><![CDATA[<p>&quot;Problem w tym, że ja chcę na raz edytować wszystkie 3 języki.&quot; - ciezko to wywnioskowac czytajac pierwszy post ;-)</p><br /><p>Czyli musisz sobie w widoku w petli wygenerowac odpowiednie pola formularza dla kazdego z jezykow np :</p><p>&lt;?php foreach($data[&quot;ProductsDescriptions&quot;] as $index =&gt; $record)&nbsp; { ?&gt;<br />&nbsp; &nbsp; &nbsp;&lt;?php e($form-&gt;hidden(&quot;ProductsDescription.{$index}.jakiesPole&quot;,array(&quot;value&quot; =&gt; $record[&quot;jakies_pole&quot;]))) ?&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp;....<br />&nbsp; &nbsp; &nbsp; &nbsp;....<br />&nbsp; &nbsp; &nbsp; &nbsp;....<br />&lt;?php } ?&gt;</p><br /><p>po submicie bedziesz miec w tablicy $this-&gt;data</p><p>taka tablice </p><p>[ProductDescription] =&gt; array(<br />&nbsp; &nbsp; &nbsp;[0] =&gt; array (&quot;jakies_pole&quot; =&gt; &quot;wartosc&quot; ......),<br />&nbsp; &nbsp; &nbsp;.....<br />&nbsp; &nbsp; &nbsp;[n] =&gt; array (&quot;jakies_pole&quot; =&gt; &quot;wartosc&quot; .......),<br />);</p><p>O ile behavior nie bedzie w stanie sam tego zapisac, musisz kazdy rekord aktualizowac z osobna rowniez w petli ..</p>]]></content>
			<author>
				<name><![CDATA[robal77]]></name>
				<uri>http://forum.cakephp.org.pl/user/143/</uri>
			</author>
			<updated>2009-08-01T15:32:53Z</updated>
			<id>http://forum.cakephp.org.pl/post/426/#p426</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Przetwarzanie danych]]></title>
			<link rel="alternate" href="http://forum.cakephp.org.pl/post/425/#p425"/>
			<content type="html"><![CDATA[<p>Spójrz na tablice Product.<br />Behavior automatycznie wyciaga dane wg. aktualnego jezyka do pól name, description, url.</p><p>Problem w tym, że ja chcę na raz edytować wszystkie 3 języki.</p>]]></content>
			<author>
				<name><![CDATA[gaw]]></name>
				<uri>http://forum.cakephp.org.pl/user/95/</uri>
			</author>
			<updated>2009-08-01T15:15:45Z</updated>
			<id>http://forum.cakephp.org.pl/post/425/#p425</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Przetwarzanie danych]]></title>
			<link rel="alternate" href="http://forum.cakephp.org.pl/post/424/#p424"/>
			<content type="html"><![CDATA[<p>Sprobuj w kontrolerze walnac taki kod przed wyciagnieciem danych z modaelu </p><p>$this-&gt;Product-&gt;locale = array(&#039;pol&#039;); <br />albo <br />$this-&gt;Product-&gt;locale = &#039;pol&#039;; </p><br /><p>Ewlentualnie zerknij w zrodla behaviora i&nbsp; poszuka stringa &quot;locale&quot; i zobacz co sie dzieje w kodzie na okolo niego.</p>]]></content>
			<author>
				<name><![CDATA[robal77]]></name>
				<uri>http://forum.cakephp.org.pl/user/143/</uri>
			</author>
			<updated>2009-08-01T15:07:43Z</updated>
			<id>http://forum.cakephp.org.pl/post/424/#p424</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Przetwarzanie danych]]></title>
			<link rel="alternate" href="http://forum.cakephp.org.pl/post/423/#p423"/>
			<content type="html"><![CDATA[<p>nie rozumiem. możesz rozwinąć pytanie?</p>]]></content>
			<author>
				<name><![CDATA[gaw]]></name>
				<uri>http://forum.cakephp.org.pl/user/95/</uri>
			</author>
			<updated>2009-08-01T15:01:11Z</updated>
			<id>http://forum.cakephp.org.pl/post/423/#p423</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Przetwarzanie danych]]></title>
			<link rel="alternate" href="http://forum.cakephp.org.pl/post/422/#p422"/>
			<content type="html"><![CDATA[<p>Moze ustawiaac pole locale&nbsp; dla wybranego jezyka ? ?</p>]]></content>
			<author>
				<name><![CDATA[robal77]]></name>
				<uri>http://forum.cakephp.org.pl/user/143/</uri>
			</author>
			<updated>2009-08-01T14:47:44Z</updated>
			<id>http://forum.cakephp.org.pl/post/422/#p422</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Przetwarzanie danych]]></title>
			<link rel="alternate" href="http://forum.cakephp.org.pl/post/419/#p419"/>
			<content type="html"><![CDATA[<p>witam,<br />korzystam z i18n do tlumaczenia zawartosci bazy.<br />Problem pojawił się przy edycji bo nie wiem jak to mogę zedytować.<br />Do i18n przesyłam name, description oraz url - i te wartosc sa zapisywane.</p><p>Jednak gdy chce odczytać dane to nie mam tego description oraz url (oczywiście w bazie sa)<br />Robię wg. tego przykładu:<br /><a href="http://book.cakephp.org/pl/view/797/Retrieve-all-translation-records-for-a-field">http://book.cakephp.org/pl/view/797/Ret … or-a-field</a></p><div class="codebox"><pre><code>$this-&gt;Product-&gt;bindTranslation(array (&#039;name&#039; =&gt; &#039;ProductsDescriptions&#039;));</code></pre></div><p>i to co zwraca mi $this-&gt;data wyglada tak</p><div class="codebox"><pre><code>[Product] =&gt; Array
                (
                    [id] =&gt; 1
                    [image] =&gt; jkh
                    [date] =&gt; 2009-07-29
                    [locale] =&gt; pol
                    [description] =&gt; opis po polsku
                    [url] =&gt; urllllll
                    [name] =&gt; nazwa produktu po polsku
                )

             

            [ProductsDescriptions] =&gt; Array
                (
                    [0] =&gt; Array
                        (
                            [id] =&gt; 1
                            [locale] =&gt; pol
                            [model] =&gt; Product
                            [foreign_key] =&gt; 1
                            [field] =&gt; name
                            [content] =&gt; nazwa produktu po polsku
                        )

                    [1] =&gt; Array
                        (
                            [id] =&gt; 4
                            [locale] =&gt; eng
                            [model] =&gt; Product
                            [foreign_key] =&gt; 1
                            [field] =&gt; name
                            [content] =&gt; nazwa po angielsku
                        )

                    [2] =&gt; Array
                        (
                            [id] =&gt; 7
                            [locale] =&gt; rus
                            [model] =&gt; Product
                            [foreign_key] =&gt; 1
                            [field] =&gt; name
                            [content] =&gt; nazwa po rusku
                        )

                )</code></pre></div><p>Jak mam wyciągnąć description i opis skoro 3 razy by byla wartosc field oraz content?</p><p>Jeśli ktoś ma jakiś pomysł - proszę o odpowiedź.</p><p>pozdr.</p>]]></content>
			<author>
				<name><![CDATA[gaw]]></name>
				<uri>http://forum.cakephp.org.pl/user/95/</uri>
			</author>
			<updated>2009-07-29T19:57:18Z</updated>
			<id>http://forum.cakephp.org.pl/post/419/#p419</id>
		</entry>
</feed>

