<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:www.nabble.com,2006:forum-14122</id>
	<title>Nabble - MetaL Dev</title>
	<updated>2008-09-19T22:20:15Z</updated>
	<link rel="self" type="application/atom+xml" href="http://www.nabble.com/MetaL-Dev-f14122.xml" />
	<link rel="alternate" type="text/html" href="http://www.nabble.com/MetaL-Dev-f14122.html" />
	<subtitle type="html">Discussion about the development of MetaL meta-programming language.</subtitle>
	
<entry>
	<id>tag:www.nabble.com,2006:post-19582782</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-19T22:20:15Z</published>
	<updated>2008-09-19T22:20:15Z</updated>
	<author>
		<name>nixanz</name>
	</author>
	<content type="html">I already know why it is being set to an empty string: &amp;nbsp;That is simply &amp;nbsp;
&lt;br&gt;what has been stored by the formsgeneration class that I'm using.
&lt;br&gt;&lt;br&gt;I would have expected metastorage to to find that a variable that &amp;nbsp;
&lt;br&gt;should be an integer is actually an empty string, and produce an &amp;nbsp;
&lt;br&gt;error, OR to convert it to NULL. &amp;nbsp;I would not expect it to go on &amp;nbsp;
&lt;br&gt;producing invalid SQL.
&lt;br&gt;&lt;br&gt;But clearly my expectation of metastorage was incorrect.
&lt;br&gt;&lt;br&gt;Thanks again for your help.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;Nik.
&lt;br&gt;&lt;br&gt;&lt;br&gt;On 20/09/2008, at 3:16 PM, Manuel Lemos wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; on 09/20/2008 02:13 AM Nik Sands said the following:
&lt;br&gt;&amp;gt; &amp;gt; Good idea. :-)
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Below is the last few lines of the var_dump($inventory_item) output.
&lt;br&gt;&amp;gt; &amp;gt; To my inexperienced eye, it appears that it has the value of an &amp;nbsp;
&lt;br&gt;&amp;gt; empty
&lt;br&gt;&amp;gt; &amp;gt; string. Perhaps the real essence of the problem, is that it is being
&lt;br&gt;&amp;gt; &amp;gt; assigned a string rather than an integer?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Below that, you can also see the debugoutput. Again, I have to ask
&lt;br&gt;&amp;gt; &amp;gt; why the '?' in the 'PrepareQuery' is not being converted into &amp;nbsp;
&lt;br&gt;&amp;gt; either a
&lt;br&gt;&amp;gt; &amp;gt; legitimate value, nor a NULL in the SQL query? (you said that it
&lt;br&gt;&amp;gt; &amp;gt; should be converted into either one or the other, but it ends up &amp;nbsp;
&lt;br&gt;&amp;gt; being
&lt;br&gt;&amp;gt; &amp;gt; converted into nothing at all, making for invalid SQL).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; [&amp;quot;grams&amp;quot;]=&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; string(0) &amp;quot;&amp;quot;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; As you may see the grams variable is set to an empty string &amp;quot;&amp;quot; and not
&lt;br&gt;&amp;gt; null as it should be. Now you need to check your code to figure why it
&lt;br&gt;&amp;gt; is not being set to null .
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Manuel Lemos
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Find and post PHP jobs
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;========================================================
&lt;br&gt;NIXANZ - &lt;a href=&quot;http://nixanz.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://nixanz.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Like to help out as a beta tester? &amp;nbsp;Let me know which application &amp;nbsp;
&lt;br&gt;you'd like to test.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19582782.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19582767</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-19T22:16:28Z</published>
	<updated>2008-09-19T22:16:28Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello
&lt;br&gt;&lt;br&gt;on 09/20/2008 02:13 AM Nik Sands said the following:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Good idea. &amp;nbsp;:-)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Below is the last few lines of the var_dump($inventory_item) output. &amp;nbsp; 
&lt;br&gt;&amp;gt; To my inexperienced eye, it appears that it has the value of an empty &amp;nbsp;
&lt;br&gt;&amp;gt; string. &amp;nbsp;Perhaps the real essence of the problem, is that it is being &amp;nbsp;
&lt;br&gt;&amp;gt; assigned a string rather than an integer?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Below that, you can also see the debugoutput. &amp;nbsp;Again, I have to ask &amp;nbsp;
&lt;br&gt;&amp;gt; why the '?' in the 'PrepareQuery' is not being converted into either a &amp;nbsp;
&lt;br&gt;&amp;gt; legitimate value, nor a NULL in the SQL query? &amp;nbsp;(you said that it &amp;nbsp;
&lt;br&gt;&amp;gt; should be converted into either one or the other, but it ends up being &amp;nbsp;
&lt;br&gt;&amp;gt; converted into nothing at all, making for invalid SQL).
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;[&amp;quot;grams&amp;quot;]=&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;string(0) &amp;quot;&amp;quot;
&lt;br&gt;&lt;br&gt;As you may see the grams variable is set to an empty string &amp;quot;&amp;quot; and not
&lt;br&gt;null as it should be. Now you need to check your code to figure why it
&lt;br&gt;is not being set to null .
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;Find and post PHP jobs
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19582767.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19582761</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-19T22:13:17Z</published>
	<updated>2008-09-19T22:13:17Z</updated>
	<author>
		<name>nixanz</name>
	</author>
	<content type="html">Good idea. &amp;nbsp;:-)
&lt;br&gt;&lt;br&gt;Below is the last few lines of the var_dump($inventory_item) output. &amp;nbsp; 
&lt;br&gt;To my inexperienced eye, it appears that it has the value of an empty &amp;nbsp;
&lt;br&gt;string. &amp;nbsp;Perhaps the real essence of the problem, is that it is being &amp;nbsp;
&lt;br&gt;assigned a string rather than an integer?
&lt;br&gt;&lt;br&gt;Below that, you can also see the debugoutput. &amp;nbsp;Again, I have to ask &amp;nbsp;
&lt;br&gt;why the '?' in the 'PrepareQuery' is not being converted into either a &amp;nbsp;
&lt;br&gt;legitimate value, nor a NULL in the SQL query? &amp;nbsp;(you said that it &amp;nbsp;
&lt;br&gt;should be converted into either one or the other, but it ends up being &amp;nbsp;
&lt;br&gt;converted into nothing at all, making for invalid SQL).
&lt;br&gt;&lt;br&gt;Thanks again for your ongoing dialogue on this issue. &amp;nbsp;Even if I've &amp;nbsp;
&lt;br&gt;been doing things incorrectly, I do want to fully understand why.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;Nik.
&lt;br&gt;&lt;br&gt;-----------------------------------------------
&lt;br&gt;&lt;br&gt;&lt;br&gt;[&amp;quot;pending&amp;quot;]=&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;int(0)
&lt;br&gt;&amp;nbsp; &amp;nbsp;[&amp;quot;id&amp;quot;]=&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;int(1105)
&lt;br&gt;&amp;nbsp; &amp;nbsp;[&amp;quot;notes&amp;quot;]=&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;string(0) &amp;quot;&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp;[&amp;quot;mandatory&amp;quot;]=&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;int(0)
&lt;br&gt;&amp;nbsp; &amp;nbsp;[&amp;quot;shared&amp;quot;]=&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;int(0)
&lt;br&gt;&amp;nbsp; &amp;nbsp;[&amp;quot;calculation&amp;quot;]=&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;string(0) &amp;quot;&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp;[&amp;quot;sort&amp;quot;]=&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;int(1)
&lt;br&gt;&amp;nbsp; &amp;nbsp;[&amp;quot;description&amp;quot;]=&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;string(0) &amp;quot;&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp;[&amp;quot;grams&amp;quot;]=&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;string(0) &amp;quot;&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp;[&amp;quot;item&amp;quot;]=&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;int(1)
&lt;br&gt;&amp;nbsp; &amp;nbsp;[&amp;quot;inventory&amp;quot;]=&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp;int(82)
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;&lt;br&gt;FACTORY DEBUG:
&lt;br&gt;&lt;br&gt;1 Query: SELECT person.id, person.external_user_id, person.name FROM &amp;nbsp;
&lt;br&gt;person WHERE person.external_user_id=2
&lt;br&gt;1 Query: SELECT inventory.id, inventory.name, inventory.description, &amp;nbsp;
&lt;br&gt;inventory.person FROM inventory WHERE id=82
&lt;br&gt;1 Query: SELECT walk.id, walk.name, walk.date, walk.persons, &amp;nbsp;
&lt;br&gt;walk.days, walk.inventory FROM walk WHERE inventory=82
&lt;br&gt;1 Query: SELECT inventory_item.id, inventory_item.notes, &amp;nbsp;
&lt;br&gt;inventory_item.mandatory, inventory_item.shared, &amp;nbsp;
&lt;br&gt;inventory_item.calculation, inventory_item.sort, &amp;nbsp;
&lt;br&gt;inventory_item.description, inventory_item.grams, inventory_item.item, &amp;nbsp;
&lt;br&gt;inventory_item.inventory FROM inventory_item WHERE inventory=82
&lt;br&gt;1 PrepareQuery: UPDATE inventory_item SET notes=?, mandatory=?, &amp;nbsp;
&lt;br&gt;shared=?, calculation=?, sort=?, description=?, grams=?, item=?, &amp;nbsp;
&lt;br&gt;inventory=? WHERE id=?
&lt;br&gt;1 Query: UPDATE inventory_item SET notes='', mandatory='N', &amp;nbsp;
&lt;br&gt;shared='N', calculation='', sort=1, description='', grams=, item=1, &amp;nbsp;
&lt;br&gt;inventory=82 WHERE id=1105
&lt;br&gt;1 Query error: You have an error in your SQL syntax; check the manual &amp;nbsp;
&lt;br&gt;that corresponds to your MySQL server version for the right syntax to &amp;nbsp;
&lt;br&gt;use near ' item=1, inventory=82 WHERE id=1105' at line 1
&lt;br&gt;&lt;br&gt;-----------------------------------------------
&lt;br&gt;&lt;br&gt;&lt;br&gt;On 20/09/2008, at 2:51 PM, Manuel Lemos wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; on 09/20/2008 01:11 AM Nik Sands said the following:
&lt;br&gt;&amp;gt; &amp;gt; But you said that a '?' in a PrepareQuery should be converted to
&lt;br&gt;&amp;gt; &amp;gt; either an SQL NULL, or to a valid value in the actual Query.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; This is not happening in this case.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If you look at the generated code you can see this for setting the
&lt;br&gt;&amp;gt; prepared query parameter of the grams field.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; if(IsSet($this-&amp;gt;grams))
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; MetabaseQuerySetInteger($this-&amp;gt;database,$statement,7,$this-&amp;gt;grams);
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; else
&lt;br&gt;&amp;gt; MetabaseQuerySetNull($this-&amp;gt;database,$statement,7,'integer');
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Maybe you think you are doing the things correctly, but you are not.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Try using var_dump($inventory_item); before calling
&lt;br&gt;&amp;gt; $inventory_item-&amp;gt;save(); and show the results here so we can double
&lt;br&gt;&amp;gt; check that the grams variable is really set to null or undefined.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Manuel Lemos
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Find and post PHP jobs
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;========================================================
&lt;br&gt;NIXANZ - &lt;a href=&quot;http://nixanz.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://nixanz.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Like to help out as a beta tester? &amp;nbsp;Let me know which application &amp;nbsp;
&lt;br&gt;you'd like to test.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19582761.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19582668</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-19T21:51:40Z</published>
	<updated>2008-09-19T21:51:40Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;on 09/20/2008 01:11 AM Nik Sands said the following:
&lt;br&gt;&amp;gt; But you said that a '?' in a PrepareQuery should be converted to &amp;nbsp;
&lt;br&gt;&amp;gt; either an SQL NULL, or to a valid value in the actual Query.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This is not happening in this case.
&lt;br&gt;&lt;br&gt;If you look at the generated code you can see this for setting the
&lt;br&gt;prepared query parameter of the grams field.
&lt;br&gt;&lt;br&gt;if(IsSet($this-&amp;gt;grams))
&lt;br&gt;{
&lt;br&gt;&amp;nbsp; MetabaseQuerySetInteger($this-&amp;gt;database,$statement,7,$this-&amp;gt;grams);
&lt;br&gt;}
&lt;br&gt;else
&lt;br&gt;&amp;nbsp; MetabaseQuerySetNull($this-&amp;gt;database,$statement,7,'integer');
&lt;br&gt;&lt;br&gt;Maybe you think you are doing the things correctly, but you are not.
&lt;br&gt;&lt;br&gt;Try using var_dump($inventory_item); before calling
&lt;br&gt;$inventory_item-&amp;gt;save(); and show the results here so we can double
&lt;br&gt;check that the grams variable is really set to null or undefined.
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;Find and post PHP jobs
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19582668.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19582493</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-19T21:11:21Z</published>
	<updated>2008-09-19T21:11:21Z</updated>
	<author>
		<name>nixanz</name>
	</author>
	<content type="html">But you said that a '?' in a PrepareQuery should be converted to &amp;nbsp;
&lt;br&gt;either an SQL NULL, or to a valid value in the actual Query.
&lt;br&gt;&lt;br&gt;This is not happening in this case.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;On 20/09/2008, at 11:45 AM, Manuel Lemos wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; on 09/19/2008 07:52 PM Nik Sands said the following:
&lt;br&gt;&amp;gt; &amp;gt; oops, sorry, I'll try again (and copy/paste as well)...
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I generated the code of the class and it is correct. If you set the
&lt;br&gt;&amp;gt; grams variable to null or unset it, it will be set a NULL on the
&lt;br&gt;&amp;gt; database record. Keep in mind that you need to set the value to PHP &amp;nbsp;
&lt;br&gt;&amp;gt; null
&lt;br&gt;&amp;gt; constant, not to &amp;quot;null&amp;quot; string.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Manuel Lemos
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Find and post PHP jobs
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;========================================================
&lt;br&gt;NIXANZ - &lt;a href=&quot;http://nixanz.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://nixanz.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Like to help out as a beta tester? &amp;nbsp;Let me know which application &amp;nbsp;
&lt;br&gt;you'd like to test.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19582493.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19581826</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-19T18:45:07Z</published>
	<updated>2008-09-19T18:45:07Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;on 09/19/2008 07:52 PM Nik Sands said the following:
&lt;br&gt;&amp;gt; oops, sorry, I'll try again (and copy/paste as well)...
&lt;br&gt;&lt;br&gt;I generated the code of the class and it is correct. If you set the
&lt;br&gt;grams variable to null or unset it, it will be set a NULL on the
&lt;br&gt;database record. Keep in mind that you need to set the value to PHP null
&lt;br&gt;constant, not to &amp;quot;null&amp;quot; string.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;Find and post PHP jobs
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19581826.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19580592</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-19T15:52:21Z</published>
	<updated>2008-09-19T15:52:21Z</updated>
	<author>
		<name>nixanz</name>
	</author>
	<content type="html">oops, sorry, I'll try again (and copy/paste as well)...
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;lt;class&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;inventory_item&amp;lt;/name&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;notes&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;text&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;optional&amp;gt;1&amp;lt;/optional&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;mandatory&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;boolean&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;shared&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;boolean&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;calculation&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;text&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;optional&amp;gt;1&amp;lt;/optional&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;sort&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;integer&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;optional&amp;gt;1&amp;lt;/optional&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;description&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;text&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;optional&amp;gt;1&amp;lt;/optional&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;grams&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;integer&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;optional&amp;gt;1&amp;lt;/optional&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;item&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;class&amp;gt;item&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;inventory&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;class&amp;gt;inventory&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;function&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;save&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;persist&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/function&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;function&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;delete&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;delete&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/function&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;function&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;validate&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;validate&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;parameters&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;errorcode&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;argument&amp;gt;errorcode&amp;lt;/argument&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/errorcode&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/parameters&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/function&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;function&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;set_inventory&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;setreference&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;parameters&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;inventory&amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;reference&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;argument&amp;gt;inventory&amp;lt;/argument&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/reference&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/parameters&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/function&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;function&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;set_item&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;setreference&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;parameters&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;item&amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;reference&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;argument&amp;gt;item&amp;lt;/argument&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/reference&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/parameters&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/function&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;function&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;get_inventory&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;getreference&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;parameters&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;inventory&amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/parameters&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/function&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;function&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;get_item&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;getreference&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;parameters&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;item&amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/parameters&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/function&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;lt;/class&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;On 20/09/2008, at 8:42 AM, Manuel Lemos wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; on 09/19/2008 07:24 PM Nik Sands said the following:
&lt;br&gt;&amp;gt; &amp;gt; Hi Manuel,
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Thanks for looking at this for me. The class definition is attached
&lt;br&gt;&amp;gt; &amp;gt; to this email.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; The '?' is not getting replaced by a value, or by NULL, which is the
&lt;br&gt;&amp;gt; &amp;gt; problem.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It seems not file was attached to the message. Can you paste the class
&lt;br&gt;&amp;gt; definition so I can try to reproduce your problem?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- &amp;nbsp;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Manuel Lemos
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Find and post PHP jobs
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;========================================================
&lt;br&gt;NIK SANDS - Systems Administrator, IT Services, University of &amp;nbsp;
&lt;br&gt;Tasmania, Australia
&lt;br&gt;Phone: &amp;nbsp;+61-3-63243732 (BH)
&lt;br&gt;AIM / iChat: &amp;nbsp;brassnix
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;========================================================
&lt;br&gt;NIXANZ - &lt;a href=&quot;http://nixanz.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://nixanz.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Like to help out as a beta tester? &amp;nbsp;Let me know which application &amp;nbsp;
&lt;br&gt;you'd like to test.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19580592.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19580480</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-19T15:42:30Z</published>
	<updated>2008-09-19T15:42:30Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;on 09/19/2008 07:24 PM Nik Sands said the following:
&lt;br&gt;&amp;gt; Hi Manuel,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks for looking at this for me. &amp;nbsp;The class definition is attached &amp;nbsp;
&lt;br&gt;&amp;gt; to this email.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The '?' is not getting replaced by a value, or by NULL, which is the &amp;nbsp;
&lt;br&gt;&amp;gt; problem.
&lt;br&gt;&lt;br&gt;It seems not file was attached to the message. Can you paste the class
&lt;br&gt;definition so I can try to reproduce your problem?
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;Find and post PHP jobs
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19580480.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19580303</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-19T15:24:57Z</published>
	<updated>2008-09-19T15:24:57Z</updated>
	<author>
		<name>nixanz</name>
	</author>
	<content type="html">Hi Manuel,
&lt;br&gt;&lt;br&gt;Thanks for looking at this for me. &amp;nbsp;The class definition is attached &amp;nbsp;
&lt;br&gt;to this email.
&lt;br&gt;&lt;br&gt;The '?' is not getting replaced by a value, or by NULL, which is the &amp;nbsp;
&lt;br&gt;problem.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;Nik.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;On 20/09/2008, at 6:44 AM, Manuel Lemos wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; on 09/19/2008 06:39 AM Nik Sands said the following:
&lt;br&gt;&amp;gt; &amp;gt; but in the situation I showed in my last example, it produces &amp;nbsp;
&lt;br&gt;&amp;gt; invalid
&lt;br&gt;&amp;gt; &amp;gt; SQL. Shouldn't this be avoided, no matter what the value of the
&lt;br&gt;&amp;gt; &amp;gt; variable?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Metastorage knew the variable had no valid value (hence it &amp;nbsp;
&lt;br&gt;&amp;gt; displaying
&lt;br&gt;&amp;gt; &amp;gt; the &amp;quot;?&amp;quot; in the &amp;quot;PrepareQuery&amp;quot; line of the debug output), shouldn't &amp;nbsp;
&lt;br&gt;&amp;gt; it
&lt;br&gt;&amp;gt; &amp;gt; be doing something with that invalid value? (Eg, set it to NULL in
&lt;br&gt;&amp;gt; &amp;gt; SQL, or report an error and don't run any SQL)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ? in the prepared query is just a place holder that will be placed by
&lt;br&gt;&amp;gt; the real value when the query is executed. If the variable is set to a
&lt;br&gt;&amp;gt; value, ? is replaced by the value. Otherwise it is replaced by NULL.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It should not give any errors if you set the variable to null .
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Anyway, just send me your class definition in the component format &amp;nbsp;
&lt;br&gt;&amp;gt; so I
&lt;br&gt;&amp;gt; can check what may not be right.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Manuel Lemos
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Find and post PHP jobs
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;========================================================
&lt;br&gt;NIK SANDS - Systems Administrator, IT Services, University of &amp;nbsp;
&lt;br&gt;Tasmania, Australia
&lt;br&gt;Phone: &amp;nbsp;+61-3-63243732 (BH)
&lt;br&gt;AIM / iChat: &amp;nbsp;brassnix
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;========================================================
&lt;br&gt;NIXANZ - &lt;a href=&quot;http://nixanz.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://nixanz.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Like to help out as a beta tester? &amp;nbsp;Let me know which application &amp;nbsp;
&lt;br&gt;you'd like to test.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19580303.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19579203</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-19T13:44:38Z</published>
	<updated>2008-09-19T13:44:38Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;on 09/19/2008 06:39 AM Nik Sands said the following:
&lt;br&gt;&amp;gt; but in the situation I showed in my last example, it produces invalid &amp;nbsp;
&lt;br&gt;&amp;gt; SQL. &amp;nbsp;Shouldn't this be avoided, no matter what the value of the &amp;nbsp;
&lt;br&gt;&amp;gt; variable?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Metastorage knew the variable had no valid value (hence it displaying &amp;nbsp;
&lt;br&gt;&amp;gt; the &amp;quot;?&amp;quot; in the &amp;quot;PrepareQuery&amp;quot; line of the debug output), shouldn't it &amp;nbsp;
&lt;br&gt;&amp;gt; be doing something with that invalid value? (Eg, set it to NULL in &amp;nbsp;
&lt;br&gt;&amp;gt; SQL, or report an error and don't run any SQL)
&lt;br&gt;&lt;br&gt;? in the prepared query is just a place holder that will be placed by
&lt;br&gt;the real value when the query is executed. If the variable is set to a
&lt;br&gt;value, ? is replaced by the value. Otherwise it is replaced by NULL.
&lt;br&gt;&lt;br&gt;It should not give any errors if you set the variable to null .
&lt;br&gt;&lt;br&gt;Anyway, just send me your class definition in the component format so I
&lt;br&gt;can check what may not be right.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;Find and post PHP jobs
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19579203.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19569240</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-19T02:39:21Z</published>
	<updated>2008-09-19T02:39:21Z</updated>
	<author>
		<name>nixanz</name>
	</author>
	<content type="html">but in the situation I showed in my last example, it produces invalid &amp;nbsp;
&lt;br&gt;SQL. &amp;nbsp;Shouldn't this be avoided, no matter what the value of the &amp;nbsp;
&lt;br&gt;variable?
&lt;br&gt;&lt;br&gt;Metastorage knew the variable had no valid value (hence it displaying &amp;nbsp;
&lt;br&gt;the &amp;quot;?&amp;quot; in the &amp;quot;PrepareQuery&amp;quot; line of the debug output), shouldn't it &amp;nbsp;
&lt;br&gt;be doing something with that invalid value? (Eg, set it to NULL in &amp;nbsp;
&lt;br&gt;SQL, or report an error and don't run any SQL)
&lt;br&gt;&lt;br&gt;&lt;br&gt;On 19/09/2008, at 5:47 PM, Manuel Lemos wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; on 09/19/2008 04:25 AM Nik Sands said the following:
&lt;br&gt;&amp;gt; &amp;gt; Is metastorage NOT supposed to replace this with a NULL in the SQL &amp;nbsp;
&lt;br&gt;&amp;gt; in
&lt;br&gt;&amp;gt; &amp;gt; this case?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Is metastorage SUPPOSED to produce invalid SQL in this instance?
&lt;br&gt;&amp;gt; &amp;gt; Shouldn't it instead be either substituting a NULL in the SQL? Or
&lt;br&gt;&amp;gt; &amp;gt; otherwise producing an error in the 'persist' routine before &amp;nbsp;
&lt;br&gt;&amp;gt; trying to
&lt;br&gt;&amp;gt; &amp;gt; run invalid SQL?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I am not sure what you mean. The code generate by Metastorage sets the
&lt;br&gt;&amp;gt; field to NULL if you set the respective optional variable to null or
&lt;br&gt;&amp;gt; just not assign any value to it.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Manuel Lemos
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Find and post PHP jobs
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;========================================================
&lt;br&gt;NIXANZ - &lt;a href=&quot;http://nixanz.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://nixanz.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Like to help out as a beta tester? &amp;nbsp;Let me know which application &amp;nbsp;
&lt;br&gt;you'd like to test.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19569240.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19567691</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-19T00:47:38Z</published>
	<updated>2008-09-19T00:47:38Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;on 09/19/2008 04:25 AM Nik Sands said the following:
&lt;br&gt;&amp;gt; Is metastorage NOT supposed to replace this with a NULL in the SQL in &amp;nbsp;
&lt;br&gt;&amp;gt; this case?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Is metastorage SUPPOSED to produce invalid SQL in this instance? &amp;nbsp; 
&lt;br&gt;&amp;gt; Shouldn't it instead be either substituting a NULL in the SQL? &amp;nbsp;Or &amp;nbsp;
&lt;br&gt;&amp;gt; otherwise producing an error in the 'persist' routine before trying to &amp;nbsp;
&lt;br&gt;&amp;gt; run invalid SQL?
&lt;br&gt;&lt;br&gt;I am not sure what you mean. The code generate by Metastorage sets the
&lt;br&gt;field to NULL if you set the respective optional variable to null or
&lt;br&gt;just not assign any value to it.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;Find and post PHP jobs
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19567691.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19567447</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-19T00:25:13Z</published>
	<updated>2008-09-19T00:25:13Z</updated>
	<author>
		<name>nixanz</name>
	</author>
	<content type="html">Hi Manuel,
&lt;br&gt;&lt;br&gt;Thanks for your help...
&lt;br&gt;&lt;br&gt;Is metastorage NOT supposed to replace this with a NULL in the SQL in &amp;nbsp;
&lt;br&gt;this case?
&lt;br&gt;&lt;br&gt;Is metastorage SUPPOSED to produce invalid SQL in this instance? &amp;nbsp; 
&lt;br&gt;Shouldn't it instead be either substituting a NULL in the SQL? &amp;nbsp;Or &amp;nbsp;
&lt;br&gt;otherwise producing an error in the 'persist' routine before trying to &amp;nbsp;
&lt;br&gt;run invalid SQL?
&lt;br&gt;&lt;br&gt;In any case, thanks for the advice on the preferred way of handling &amp;nbsp;
&lt;br&gt;the situation - I'll give it a try. &amp;nbsp;It's unfortunate that it is &amp;nbsp;
&lt;br&gt;necessary, but it should do the job for now.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;Nik.
&lt;br&gt;&lt;br&gt;&lt;br&gt;On 19/09/2008, at 4:23 PM, Manuel Lemos wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; on 09/19/2008 02:01 AM Nik Sands said the following:
&lt;br&gt;&amp;gt; &amp;gt; The code immediately below fails to save (and gives the debug output
&lt;br&gt;&amp;gt; &amp;gt; shown below), but if I uncomment the two &amp;quot;Work around&amp;quot; lines, it &amp;nbsp;
&lt;br&gt;&amp;gt; saves
&lt;br&gt;&amp;gt; &amp;gt; successfully. Why is this?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; The debug output is the same as posted earlier in this topic.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I think there is some confusion. An empty string is one thing. An
&lt;br&gt;&amp;gt; undefined value is another thing.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; $grams = $form-&amp;gt;GetInputValue(&amp;quot;item_&amp;quot;.$id.&amp;quot;_grams&amp;quot;);
&lt;br&gt;&amp;gt; &amp;gt; if ( IsSet($grams) )
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The above should be:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; if(strlen($grams))
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; $inventory_item-&amp;gt;grams = $grams;
&lt;br&gt;&amp;gt; &amp;gt; else
&lt;br&gt;&amp;gt; &amp;gt; $inventory_item-&amp;gt;grams = null;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Manuel Lemos
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Find and post PHP jobs
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;========================================================
&lt;br&gt;NIXANZ - &lt;a href=&quot;http://nixanz.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://nixanz.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Like to help out as a beta tester? &amp;nbsp;Let me know which application &amp;nbsp;
&lt;br&gt;you'd like to test.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19567447.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19566863</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-18T23:23:20Z</published>
	<updated>2008-09-18T23:23:20Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;on 09/19/2008 02:01 AM Nik Sands said the following:
&lt;br&gt;&amp;gt; The code immediately below fails to save (and gives the debug output &amp;nbsp;
&lt;br&gt;&amp;gt; shown below), but if I uncomment the two &amp;quot;Work around&amp;quot; lines, it saves &amp;nbsp;
&lt;br&gt;&amp;gt; successfully. &amp;nbsp;Why is this?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The debug output is the same as posted earlier in this topic.
&lt;br&gt;&lt;br&gt;I think there is some confusion. An empty string is one thing. An
&lt;br&gt;undefined value is another thing.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; $grams = $form-&amp;gt;GetInputValue(&amp;quot;item_&amp;quot;.$id.&amp;quot;_grams&amp;quot;);
&lt;br&gt;&amp;gt; if ( IsSet($grams) )
&lt;br&gt;&lt;br&gt;The above should be:
&lt;br&gt;&lt;br&gt;if(strlen($grams))
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$inventory_item-&amp;gt;grams = $grams;
&lt;br&gt;&amp;gt; else
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$inventory_item-&amp;gt;grams = null;
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;Find and post PHP jobs
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19566863.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19566265</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-18T22:01:53Z</published>
	<updated>2008-09-18T22:01:53Z</updated>
	<author>
		<name>nixanz</name>
	</author>
	<content type="html">Sorry, my last email was probably not very clear. &amp;nbsp;Let me try &amp;nbsp;
&lt;br&gt;again... &amp;nbsp;:-)
&lt;br&gt;&lt;br&gt;The code immediately below fails to save (and gives the debug output &amp;nbsp;
&lt;br&gt;shown below), but if I uncomment the two &amp;quot;Work around&amp;quot; lines, it saves &amp;nbsp;
&lt;br&gt;successfully. &amp;nbsp;Why is this?
&lt;br&gt;&lt;br&gt;The debug output is the same as posted earlier in this topic.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;Nik.
&lt;br&gt;&lt;br&gt;&lt;br&gt;$grams = $form-&amp;gt;GetInputValue(&amp;quot;item_&amp;quot;.$id.&amp;quot;_grams&amp;quot;);
&lt;br&gt;if ( IsSet($grams) )
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$inventory_item-&amp;gt;grams = $grams;
&lt;br&gt;else
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$inventory_item-&amp;gt;grams = null;
&lt;br&gt;&lt;br&gt;// &amp;nbsp;Work around metastorage invalid SQL issue
&lt;br&gt;//if ( ! $inventory_item-&amp;gt;grams )
&lt;br&gt;// &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$inventory_item-&amp;gt;grams = null;
&lt;br&gt;&lt;br&gt;if ( ! $inventory_item-&amp;gt;save() )
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;exit_error(&amp;quot;Failed to save data for inventory item '&amp;quot;. 
&lt;br&gt;$inventory_item-&amp;gt;id.&amp;quot;'&amp;quot;);
&lt;br&gt;&lt;br&gt;&lt;br&gt;On 19/09/2008, at 2:35 PM, Manuel Lemos wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; on 09/19/2008 01:33 AM Nik Sands said the following:
&lt;br&gt;&amp;gt; &amp;gt; it is optional:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; ...
&lt;br&gt;&amp;gt; &amp;gt; &amp;lt;variable&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;lt;name&amp;gt;grams&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;lt;type&amp;gt;integer&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;lt;optional&amp;gt;1&amp;lt;/optional&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; ...
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; It is being assigned immediately before the save() as follows:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; $inventory_item-&amp;gt;grams = $form-&amp;gt;GetInputValue(&amp;quot;item_&amp;quot;.$id.&amp;quot;_grams&amp;quot;);
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; In this case, it is being assigned an empty value.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; That is the problem. If it is empty, don't assign it or set it to &amp;nbsp;
&lt;br&gt;&amp;gt; null .
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Manuel Lemos
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Find and post PHP jobs
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;========================================================
&lt;br&gt;NIXANZ - &lt;a href=&quot;http://nixanz.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://nixanz.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Like to help out as a beta tester? &amp;nbsp;Let me know which application &amp;nbsp;
&lt;br&gt;you'd like to test.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19566265.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19566191</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-18T21:48:14Z</published>
	<updated>2008-09-18T21:48:14Z</updated>
	<author>
		<name>nixanz</name>
	</author>
	<content type="html">I thought metastorage was supposed to set it to NULL when generating &amp;nbsp;
&lt;br&gt;the SQL automatically?
&lt;br&gt;&lt;br&gt;The debug output shows it as being a '?' in the prepared query, but &amp;nbsp;
&lt;br&gt;nothing in the finaly query.
&lt;br&gt;&lt;br&gt;Does this mean I have to check for empty values on every single &amp;nbsp;
&lt;br&gt;assignment in metastorage???
&lt;br&gt;&lt;br&gt;Anyhow, I've tried this as follows, and it still doesn't work (still &amp;nbsp;
&lt;br&gt;produces the same debug output):
&lt;br&gt;&lt;br&gt;$grams = $form-&amp;gt;GetInputValue(&amp;quot;item_&amp;quot;.$id.&amp;quot;_grams&amp;quot;);
&lt;br&gt;if ( IsSet($grams) )
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$inventory_item-&amp;gt;grams = $form-&amp;gt;GetInputValue(&amp;quot;item_&amp;quot;. 
&lt;br&gt;$id.&amp;quot;_grams&amp;quot;);
&lt;br&gt;&lt;br&gt;if ( ! $inventory_item-&amp;gt;save() )
&lt;br&gt;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;exit_error(&amp;quot;Failed to save data for inventory item '&amp;quot;. 
&lt;br&gt;$inventory_item-&amp;gt;id.&amp;quot;'&amp;quot;);
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;&lt;br&gt;On 19/09/2008, at 2:35 PM, Manuel Lemos wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; on 09/19/2008 01:33 AM Nik Sands said the following:
&lt;br&gt;&amp;gt; &amp;gt; it is optional:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; ...
&lt;br&gt;&amp;gt; &amp;gt; &amp;lt;variable&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;lt;name&amp;gt;grams&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;lt;type&amp;gt;integer&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;lt;optional&amp;gt;1&amp;lt;/optional&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; ...
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; It is being assigned immediately before the save() as follows:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; $inventory_item-&amp;gt;grams = $form-&amp;gt;GetInputValue(&amp;quot;item_&amp;quot;.$id.&amp;quot;_grams&amp;quot;);
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; In this case, it is being assigned an empty value.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; That is the problem. If it is empty, don't assign it or set it to &amp;nbsp;
&lt;br&gt;&amp;gt; null .
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Manuel Lemos
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Find and post PHP jobs
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;========================================================
&lt;br&gt;NIK SANDS - Systems Administrator, IT Services, University of &amp;nbsp;
&lt;br&gt;Tasmania, Australia
&lt;br&gt;Phone: &amp;nbsp;+61-3-63243732 (BH)
&lt;br&gt;AIM / iChat: &amp;nbsp;brassnix
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;========================================================
&lt;br&gt;NIXANZ - &lt;a href=&quot;http://nixanz.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://nixanz.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Like to help out as a beta tester? &amp;nbsp;Let me know which application &amp;nbsp;
&lt;br&gt;you'd like to test.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19566191.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19566097</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-18T21:35:13Z</published>
	<updated>2008-09-18T21:35:13Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;on 09/19/2008 01:33 AM Nik Sands said the following:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; it is optional:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ...
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;grams&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;integer&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;optional&amp;gt;1&amp;lt;/optional&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;gt; ...
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; It is being assigned immediately before the save() as follows:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; $inventory_item-&amp;gt;grams = $form-&amp;gt;GetInputValue(&amp;quot;item_&amp;quot;.$id.&amp;quot;_grams&amp;quot;);
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; In this case, it is being assigned an empty value.
&lt;/div&gt;&lt;br&gt;That is the problem. If it is empty, don't assign it or set it to null .
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;Find and post PHP jobs
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19566097.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19566089</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-18T21:33:27Z</published>
	<updated>2008-09-18T21:33:27Z</updated>
	<author>
		<name>nixanz</name>
	</author>
	<content type="html">it is optional:
&lt;br&gt;&lt;br&gt;...
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;grams&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;integer&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;optional&amp;gt;1&amp;lt;/optional&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/variable&amp;gt;
&lt;br&gt;...
&lt;br&gt;&lt;br&gt;It is being assigned immediately before the save() as follows:
&lt;br&gt;&lt;br&gt;$inventory_item-&amp;gt;grams = $form-&amp;gt;GetInputValue(&amp;quot;item_&amp;quot;.$id.&amp;quot;_grams&amp;quot;);
&lt;br&gt;&lt;br&gt;In this case, it is being assigned an empty value.
&lt;br&gt;&lt;br&gt;&lt;br&gt;On 19/09/2008, at 2:24 PM, Manuel Lemos wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; on 09/19/2008 01:13 AM nixanz said the following:
&lt;br&gt;&amp;gt; &amp;gt; 1 PrepareQuery: UPDATE inventory_item SET notes=?, mandatory=?,
&lt;br&gt;&amp;gt; &amp;gt; shared=?, calculation=?, sort=?, description=?, grams=?, item=?,
&lt;br&gt;&amp;gt; &amp;gt; inventory=? WHERE id=?
&lt;br&gt;&amp;gt; &amp;gt; 1 Query: UPDATE inventory_item SET notes='', mandatory='N',
&lt;br&gt;&amp;gt; &amp;gt; shared='N', calculation='', sort=1, description='', grams=, item=10,
&lt;br&gt;&amp;gt; &amp;gt; inventory=75 WHERE id=792
&lt;br&gt;&amp;gt; &amp;gt; 1 Query error: You have an error in your SQL syntax; check the &amp;nbsp;
&lt;br&gt;&amp;gt; manual
&lt;br&gt;&amp;gt; &amp;gt; that corresponds to your MySQL server version for the right syntax &amp;nbsp;
&lt;br&gt;&amp;gt; to
&lt;br&gt;&amp;gt; &amp;gt; use near ' item=10, inventory=75 WHERE id=792' at line 1
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; You can clearly see that the 'grams' field in the 'PrepareQuery' is
&lt;br&gt;&amp;gt; &amp;gt; '?' (ie, 'grams' has not yet been defined for this object), but in &amp;nbsp;
&lt;br&gt;&amp;gt; the
&lt;br&gt;&amp;gt; &amp;gt; 'Query' line below that, the 'grams' is simply blank. I was under &amp;nbsp;
&lt;br&gt;&amp;gt; the
&lt;br&gt;&amp;gt; &amp;gt; impression that Metastorage should be making it a 'NULL'.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Is this what is supposed to happen?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Or do I have to manually check each and every field every time &amp;nbsp;
&lt;br&gt;&amp;gt; before
&lt;br&gt;&amp;gt; &amp;gt; I 'persist'?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If the variable can be set to NULL, it means it is optional. Are you
&lt;br&gt;&amp;gt; defining it as &amp;lt;optional&amp;gt;1&amp;lt;/optional&amp;gt; ?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The generated class should fail the persist function if you do not set
&lt;br&gt;&amp;gt; it to optional and you do not initialize its value. Are you assigning
&lt;br&gt;&amp;gt; the variable value to something?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Manuel Lemos
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Find and post PHP jobs
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;========================================================
&lt;br&gt;NIXANZ - &lt;a href=&quot;http://nixanz.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://nixanz.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Like to help out as a beta tester? &amp;nbsp;Let me know which application &amp;nbsp;
&lt;br&gt;you'd like to test.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19566089.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19566031</id>
	<title>Re: Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-18T21:24:03Z</published>
	<updated>2008-09-18T21:24:03Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;on 09/19/2008 01:13 AM nixanz said the following:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 1 PrepareQuery: UPDATE inventory_item SET notes=?, mandatory=?,
&lt;br&gt;&amp;gt; shared=?, calculation=?, sort=?, description=?, grams=?, item=?,
&lt;br&gt;&amp;gt; inventory=? WHERE id=?
&lt;br&gt;&amp;gt; 1 Query: UPDATE inventory_item SET notes='', mandatory='N',
&lt;br&gt;&amp;gt; shared='N', calculation='', sort=1, description='', grams=, item=10,
&lt;br&gt;&amp;gt; inventory=75 WHERE id=792
&lt;br&gt;&amp;gt; 1 Query error: You have an error in your SQL syntax; check the manual
&lt;br&gt;&amp;gt; that corresponds to your MySQL server version for the right syntax to
&lt;br&gt;&amp;gt; use near ' item=10, inventory=75 WHERE id=792' at line 1
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; You can clearly see that the 'grams' field in the 'PrepareQuery' is
&lt;br&gt;&amp;gt; '?' (ie, 'grams' has not yet been defined for this object), but in the
&lt;br&gt;&amp;gt; 'Query' line below that, the 'grams' is simply blank. &amp;nbsp;I was under the
&lt;br&gt;&amp;gt; impression that Metastorage should be making it a 'NULL'. &amp;nbsp;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Is this what is supposed to happen?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Or do I have to manually check each and every field every time before
&lt;br&gt;&amp;gt; I 'persist'?
&lt;/div&gt;&lt;br&gt;If the variable can be set to NULL, it means it is optional. Are you
&lt;br&gt;defining it as &amp;lt;optional&amp;gt;1&amp;lt;/optional&amp;gt; ?
&lt;br&gt;&lt;br&gt;The generated class should fail the persist function if you do not set
&lt;br&gt;it to optional and you do not initialize its value. Are you assigning
&lt;br&gt;the variable value to something?
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;Find and post PHP jobs
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/jobs/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/jobs/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19566031.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19565988</id>
	<title>Metastorage 'persist' function producing invalid SQL</title>
	<published>2008-09-18T21:13:31Z</published>
	<updated>2008-09-18T21:13:31Z</updated>
	<author>
		<name>nixanz</name>
	</author>
	<content type="html">I'm new to Metastorage, so forgive me if I've overlooked something
&lt;br&gt;obvious. &amp;nbsp;Anyhow, I can't get my persist function to work reliably. 
&lt;br&gt;I've using the same function for the same class in several places, and
&lt;br&gt;it works correctly in most cases, but in one particular spot, it
&lt;br&gt;always fails with a &amp;quot;You have an error in your SQL syntax...&amp;quot; error.
&lt;br&gt;&lt;br&gt;I've got debugging turned on, and the debugging output is:
&lt;br&gt;&lt;br&gt;1 Query: SELECT person.id, person.external_user_id, person.name FROM
&lt;br&gt;person WHERE person.external_user_id=2
&lt;br&gt;1 Query: SELECT inventory.id, inventory.name, inventory.description,
&lt;br&gt;inventory.person FROM inventory WHERE id=75
&lt;br&gt;1 Query: SELECT walk.id, walk.name, walk.date, walk.persons,
&lt;br&gt;walk.days, walk.inventory FROM walk WHERE inventory=75
&lt;br&gt;1 Query: SELECT inventory_item.id, inventory_item.notes,
&lt;br&gt;inventory_item.mandatory, inventory_item.shared,
&lt;br&gt;inventory_item.calculation, inventory_item.sort,
&lt;br&gt;inventory_item.description, inventory_item.grams, inventory_item.item,
&lt;br&gt;inventory_item.inventory FROM inventory_item WHERE inventory=75
&lt;br&gt;1 PrepareQuery: UPDATE inventory_item SET notes=?, mandatory=?,
&lt;br&gt;shared=?, calculation=?, sort=?, description=?, grams=?, item=?,
&lt;br&gt;inventory=? WHERE id=?
&lt;br&gt;1 Query: UPDATE inventory_item SET notes='', mandatory='N',
&lt;br&gt;shared='N', calculation='', sort=1, description='', grams=, item=10,
&lt;br&gt;inventory=75 WHERE id=792
&lt;br&gt;1 Query error: You have an error in your SQL syntax; check the manual
&lt;br&gt;that corresponds to your MySQL server version for the right syntax to
&lt;br&gt;use near ' item=10, inventory=75 WHERE id=792' at line 1
&lt;br&gt;&lt;br&gt;You can clearly see that the 'grams' field in the 'PrepareQuery' is
&lt;br&gt;'?' (ie, 'grams' has not yet been defined for this object), but in the
&lt;br&gt;'Query' line below that, the 'grams' is simply blank. &amp;nbsp;I was under the
&lt;br&gt;impression that Metastorage should be making it a 'NULL'. &amp;nbsp;
&lt;br&gt;&lt;br&gt;Is this what is supposed to happen?
&lt;br&gt;&lt;br&gt;Or do I have to manually check each and every field every time before
&lt;br&gt;I 'persist'?
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Metastorage-%27persist%27-function-producing-invalid-SQL-tp19565988p19565988.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-17506486</id>
	<title>Re: Converting PHP, Perl, Python, etc to Metal?</title>
	<published>2008-05-28T00:13:13Z</published>
	<updated>2008-05-28T00:13:13Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;on 05/24/2008 05:54 PM Kelly Jones said the following:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Are there tools to convert PHP/Perl/Python/etc to Metal?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; When I see:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; function addargs ($x,$y) {$z=$x+y; return $z;}
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I think (using brackets because some mail clients don't like angle brackets):
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; [function name=&amp;quot;addargs&amp;quot;]
&lt;br&gt;&amp;gt; &amp;nbsp;[arglist]
&lt;br&gt;&amp;gt; &amp;nbsp; [arg name=&amp;quot;x&amp;quot; type=&amp;quot;unknown&amp;quot;]
&lt;br&gt;&amp;gt; &amp;nbsp; [arg name=&amp;quot;y&amp;quot; type=&amp;quot;unknown&amp;quot;]
&lt;br&gt;&amp;gt; &amp;nbsp;[/arglist]
&lt;br&gt;&amp;gt; &amp;nbsp;[body]
&lt;br&gt;&amp;gt; &amp;nbsp; [line]z=x+y[/line]
&lt;br&gt;&amp;gt; &amp;nbsp; [return]z[/return]
&lt;br&gt;&amp;gt; &amp;nbsp;[/body]
&lt;br&gt;&amp;gt; [/function]
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I realize that's not perfect Metal, but you get the idea.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I know PHP/Perl etc all have a &amp;quot;lexical/tokenizing&amp;quot; step when they're
&lt;br&gt;&amp;gt; compiled-- could they be converted to Metal at that step?
&lt;/div&gt;&lt;br&gt;AFAIK there are no tools for converting between languages. It is a
&lt;br&gt;possibility, but the MetaL project did not went into that direction.
&lt;br&gt;&lt;br&gt;Nowadays, most of the development has been done on the persistence
&lt;br&gt;module which the base of Metastorage ORM code generation tool.
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;PHP professionals looking for PHP jobs
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/professionals/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/professionals/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Converting-PHP%2C-Perl%2C-Python%2C-etc-to-Metal--tp17452081p17506486.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-17452081</id>
	<title>Converting PHP, Perl, Python, etc to Metal?</title>
	<published>2008-05-24T13:54:16Z</published>
	<updated>2008-05-24T13:54:16Z</updated>
	<author>
		<name>kellyterryjones</name>
	</author>
	<content type="html">Are there tools to convert PHP/Perl/Python/etc to Metal?
&lt;br&gt;&lt;br&gt;When I see:
&lt;br&gt;&lt;br&gt;function addargs ($x,$y) {$z=$x+y; return $z;}
&lt;br&gt;&lt;br&gt;I think (using brackets because some mail clients don't like angle brackets):
&lt;br&gt;&lt;br&gt;[function name=&amp;quot;addargs&amp;quot;]
&lt;br&gt;&amp;nbsp;[arglist]
&lt;br&gt;&amp;nbsp; [arg name=&amp;quot;x&amp;quot; type=&amp;quot;unknown&amp;quot;]
&lt;br&gt;&amp;nbsp; [arg name=&amp;quot;y&amp;quot; type=&amp;quot;unknown&amp;quot;]
&lt;br&gt;&amp;nbsp;[/arglist]
&lt;br&gt;&amp;nbsp;[body]
&lt;br&gt;&amp;nbsp; [line]z=x+y[/line]
&lt;br&gt;&amp;nbsp; [return]z[/return]
&lt;br&gt;&amp;nbsp;[/body]
&lt;br&gt;[/function]
&lt;br&gt;&lt;br&gt;I realize that's not perfect Metal, but you get the idea.
&lt;br&gt;&lt;br&gt;I know PHP/Perl etc all have a &amp;quot;lexical/tokenizing&amp;quot; step when they're
&lt;br&gt;compiled-- could they be converted to Metal at that step?
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;We're just a Bunch Of Regular Guys, a collective group that's trying
&lt;br&gt;to understand and assimilate technology. We feel that resistance to
&lt;br&gt;new ideas and technology is unwise and ultimately futile.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Converting-PHP%2C-Perl%2C-Python%2C-etc-to-Metal--tp17452081p17452081.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16821817</id>
	<title>Re: obj. relations question</title>
	<published>2008-04-21T15:41:12Z</published>
	<updated>2008-04-21T15:41:12Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;on 04/21/2008 08:12 AM Sergey Klenin said the following:
&lt;br&gt;&amp;gt; I feel like I'm inventing a wheel because it seems I'm trying to do the thing that is always done.
&lt;br&gt;&amp;gt; I see that it will be meta meta system, but how to handle my needs in more effective way?
&lt;br&gt;&amp;gt; Maybe the way I'm trying to solve this problem now is fundamentaly mistaken and I have to use native metastorage capabilities to achieve end user fuctionality?
&lt;br&gt;&amp;gt; In short, I'm stuck.
&lt;br&gt;&lt;br&gt;This is a bit confusing, not because of your definitions, but rather
&lt;br&gt;because you do not tell me what exactly what you want to do and you are
&lt;br&gt;not able to do it.
&lt;br&gt;&lt;br&gt;Anyway, if you want a meta type system, first you need to have classes
&lt;br&gt;that describe your types. Then you to have classes that store the type
&lt;br&gt;values.
&lt;br&gt;&lt;br&gt;You separated each thing in two components but that is inconvenient
&lt;br&gt;because the factory of one component will not be able to fetch objects
&lt;br&gt;of the other component. You can pass OID back and forth but that may be
&lt;br&gt;a drag.
&lt;br&gt;&lt;br&gt;Anyway, I think first you should design a class model with some UML tool
&lt;br&gt;like Umbrello or others, than you move on to the model implementation
&lt;br&gt;using Metastorage.
&lt;br&gt;&lt;br&gt;Once you have your model diagram ready it is easier to see what do you
&lt;br&gt;want to do and what your model is not allowing, so I can advise. So,
&lt;br&gt;just design your model and show your diagram when you get stuck.
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;PHP professionals looking for PHP jobs
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/professionals/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/professionals/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/obj.-relations-question-tp16816319p16821817.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16816319</id>
	<title>obj. relations question</title>
	<published>2008-04-21T04:12:19Z</published>
	<updated>2008-04-21T04:12:19Z</updated>
	<author>
		<name>Sergey Klenin</name>
	</author>
	<content type="html">Hello, Manuael and everybody,
&lt;br&gt;&lt;br&gt;I have the question regarding how to set up classes relationship.
&lt;br&gt;&lt;br&gt;I'm designing the system that must provide to end user the capabilities to describe and create custom object types.
&lt;br&gt;Such objects may have custom variables, validators, behaviour etc.
&lt;br&gt;&lt;br&gt;I have 2 components named 'Object_prototypes' and 'Object_instances' (verbose names here for simplicity).
&lt;br&gt;&lt;br&gt;Object_prototypes contains metadata for future object that will be created by end user.
&lt;br&gt;Among of all this component contains class called 'Properties' that describes properties of certain object (created by end user).
&lt;br&gt;Fragment of 'Object_prototypes' definition:
&lt;br&gt;&lt;br&gt;&amp;lt;component&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;lt;name&amp;gt;Object_prototypes&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; ...
&lt;br&gt;&amp;nbsp; &amp;lt;class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;Objects&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; ...
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;title&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;type&amp;gt;text&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;collection&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;properties&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;Properties&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;reference&amp;gt;title&amp;lt;/reference&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/collection&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; ...
&lt;br&gt;&amp;nbsp; &amp;lt;class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;Properties&amp;lt;/name&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;title&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;type&amp;gt;text&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;collection&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;type&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;property_type&amp;lt;/class&amp;gt; &amp;lt;!-- the type class not shown --&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;reference&amp;gt;type&amp;lt;/reference&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/collection&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;value&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;type&amp;gt;text&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;default_value&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;type&amp;gt;text&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; ...
&lt;br&gt;&amp;lt;/component&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;Further, the component 'Object_instances' will contains object instances created by end user based on one of 'Object_prototypes' class object.
&lt;br&gt;Each object must have its own set of properties regarding to template this object based on.
&lt;br&gt;The instance of object of certain type may have 'private' value of any property either must take default value from 'prototype' if private value not specified.
&lt;br&gt;&lt;br&gt;Fragment of 'Object_instances' definition:
&lt;br&gt;&lt;br&gt;&amp;lt;component&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;lt;name&amp;gt;Object_instances&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; ...
&lt;br&gt;&amp;nbsp; &amp;lt;class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;Instance&amp;lt;/name&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;title&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;type&amp;gt;text&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;template&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;component&amp;gt;Object_prototypes&amp;lt;/component&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;Objects&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;collection&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;properties&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;instance_properties&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;reference&amp;gt;title&amp;lt;/reference&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/collection&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;lt;/class&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;lt;class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;instance_properties&amp;lt;/name&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;!-- below I'm stuck --&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;property&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;component&amp;gt;Object_prototypes&amp;lt;/component&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;Properties&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;value&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;type&amp;gt;text&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; ...
&lt;br&gt;&amp;lt;/component&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;I feel like I'm inventing a wheel because it seems I'm trying to do the thing that is always done.
&lt;br&gt;I see that it will be meta meta system, but how to handle my needs in more effective way?
&lt;br&gt;Maybe the way I'm trying to solve this problem now is fundamentaly mistaken and I have to use native metastorage capabilities to achieve end user fuctionality?
&lt;br&gt;In short, I'm stuck.
&lt;br&gt;&lt;br&gt;Besr regards,
&lt;br&gt;Sergey Klenin
&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/obj.-relations-question-tp16816319p16816319.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16066115</id>
	<title>Re: defining external components</title>
	<published>2008-03-15T02:40:07Z</published>
	<updated>2008-03-15T02:40:07Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;on 03/13/2008 09:28 AM Miguel Oliveira said the following:
&lt;br&gt;&amp;gt; My application, metastorage-based, is growing every day, and the main &amp;nbsp;
&lt;br&gt;&amp;gt; persistent component is getting bigger.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; In order do organize code and data flow, i'm planning to create &amp;nbsp;
&lt;br&gt;&amp;gt; external components to increase productivity.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So, i was wondering if, when creating external components, &amp;nbsp;
&lt;br&gt;&amp;gt; metastorage will create other databases or will assume that future &amp;nbsp;
&lt;br&gt;&amp;gt; components will be added to the main component database.
&lt;br&gt;&lt;br&gt;No, Metastorage generates different schema definitions for each
&lt;br&gt;component, but you can configure the schema installation classes to
&lt;br&gt;install all component schemas in the same database.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; Also, maybe this dobt doesn't make much sense, but can i create the &amp;nbsp;
&lt;br&gt;&amp;gt; main component just for reference external components? Will this &amp;nbsp;
&lt;br&gt;&amp;gt; affect all my code and database, or metastorage will mantain database &amp;nbsp;
&lt;br&gt;&amp;gt; and a a main class will work as an interface layer class?
&lt;br&gt;&lt;br&gt;I am not sure what you mean. If you have a large application, it is
&lt;br&gt;better to make it modular, so each module can run without code from most
&lt;br&gt;other modules.
&lt;br&gt;&lt;br&gt;If you define different components for each module, most of the time you
&lt;br&gt;only need to load the generated code for the components used in each module.
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;PHP professionals looking for PHP jobs
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/professionals/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/professionals/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/defining-external-components-tp16027262p16066115.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16027262</id>
	<title>defining external components</title>
	<published>2008-03-13T05:28:40Z</published>
	<updated>2008-03-13T05:28:40Z</updated>
	<author>
		<name>Miguel Oliveira-3</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;My application, metastorage-based, is growing every day, and the main &amp;nbsp;
&lt;br&gt;persistent component is getting bigger.
&lt;br&gt;&lt;br&gt;In order do organize code and data flow, i'm planning to create &amp;nbsp;
&lt;br&gt;external components to increase productivity.
&lt;br&gt;&lt;br&gt;So, i was wondering if, when creating external components, &amp;nbsp;
&lt;br&gt;metastorage will create other databases or will assume that future &amp;nbsp;
&lt;br&gt;components will be added to the main component database.
&lt;br&gt;&lt;br&gt;Also, maybe this dobt doesn't make much sense, but can i create the &amp;nbsp;
&lt;br&gt;main component just for reference external components? Will this &amp;nbsp;
&lt;br&gt;affect all my code and database, or metastorage will mantain database &amp;nbsp;
&lt;br&gt;and a a main class will work as an interface layer class?
&lt;br&gt;&lt;br&gt;&lt;br&gt;Thanks in advance,
&lt;br&gt;miguel
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/defining-external-components-tp16027262p16027262.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-15620033</id>
	<title>Re: setreference for foreign keys in 1-to-1 relationshipship</title>
	<published>2008-02-21T12:06:44Z</published>
	<updated>2008-02-21T12:06:44Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;on 02/21/2008 11:32 AM Miguel Oliveira said the following:
&lt;br&gt;&amp;gt; I've created 2 object factory functions of type createobject, one for &amp;nbsp;
&lt;br&gt;&amp;gt; each class of user and profile. But it returns that a missing &amp;nbsp;
&lt;br&gt;&amp;gt; argument is missing, which is the profile_id and user_id.
&lt;br&gt;&lt;br&gt;Yes, you need to make those variables optional to be allowed to save the
&lt;br&gt;object without setting them to a reference object.
&lt;br&gt;&lt;br&gt;Since the classes reference each other, you need to make at least one of
&lt;br&gt;the variables optional.
&lt;br&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; As it sustends 'applications should not access reference variables &amp;nbsp;
&lt;br&gt;&amp;gt; directly to manipulate the respective objects. Instead you should &amp;nbsp;
&lt;br&gt;&amp;gt; declare and use functions of type setreference and getreference to &amp;nbsp;
&lt;br&gt;&amp;gt; assign or retrieve the related objects by storing or de-referencing &amp;nbsp;
&lt;br&gt;&amp;gt; the respective OID. '
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; And:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 'Applications should not access reference variables directly to &amp;nbsp;
&lt;br&gt;&amp;gt; manipulate the respective objects. Instead you should declare and use &amp;nbsp;
&lt;br&gt;&amp;gt; functions of type setreference and getreference to assign or retrieve &amp;nbsp;
&lt;br&gt;&amp;gt; the related objects by storing or de-referencing the respective OID. &amp;nbsp;
&lt;br&gt;&amp;gt; See the section ahead about defining data objects functions to learn &amp;nbsp;
&lt;br&gt;&amp;gt; how to declare and use this type of functions.'
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; How can i create object user and profile and set references in a form &amp;nbsp;
&lt;br&gt;&amp;gt; of 1-to-1 relationship? Like this?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;function&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;setprofileid&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;setreference&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;parameters&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;profile_id&amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;reference&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;argument&amp;gt;profile&amp;lt;/argument&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/reference&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/parameters&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/function&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;function&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;setuserid&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;setreference&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;parameters&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;user_id&amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;reference&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;argument&amp;gt;user&amp;lt;/argument&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/reference&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/parameters&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/function&amp;gt;
&lt;/div&gt;&lt;br&gt;Yes, that is it. You just need to add the functions the respective classes.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; Also, should i call these functions before persist the database?
&lt;br&gt;&lt;br&gt;Of course.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;PHP professionals looking for PHP jobs
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/professionals/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/professionals/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/setreference-for-foreign-keys-in-1-to-1-relationshipship-tp15612644p15620033.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-15612644</id>
	<title>setreference for foreign keys in 1-to-1 relationshipship</title>
	<published>2008-02-21T06:32:12Z</published>
	<updated>2008-02-21T06:32:12Z</updated>
	<author>
		<name>Miguel Oliveira-3</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;I was wondering how can i solve the creation of 2 objects with an 1- 
&lt;br&gt;to-1 relationship. Using this example class:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;lt;class&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;user&amp;lt;/name&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;profile_id&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;profile&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;lt;/class&amp;gt;
&lt;br&gt;&lt;br&gt;and...
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;lt;class&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;profile&amp;lt;/name&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;user_id&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;user&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/variable&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;lt;/class&amp;gt;
&lt;br&gt;&lt;br&gt;I've created 2 object factory functions of type createobject, one for &amp;nbsp;
&lt;br&gt;each class of user and profile. But it returns that a missing &amp;nbsp;
&lt;br&gt;argument is missing, which is the profile_id and user_id.
&lt;br&gt;&lt;br&gt;As it sustends 'applications should not access reference variables &amp;nbsp;
&lt;br&gt;directly to manipulate the respective objects. Instead you should &amp;nbsp;
&lt;br&gt;declare and use functions of type setreference and getreference to &amp;nbsp;
&lt;br&gt;assign or retrieve the related objects by storing or de-referencing &amp;nbsp;
&lt;br&gt;the respective OID. '
&lt;br&gt;&lt;br&gt;And:
&lt;br&gt;&lt;br&gt;'Applications should not access reference variables directly to &amp;nbsp;
&lt;br&gt;manipulate the respective objects. Instead you should declare and use &amp;nbsp;
&lt;br&gt;functions of type setreference and getreference to assign or retrieve &amp;nbsp;
&lt;br&gt;the related objects by storing or de-referencing the respective OID. &amp;nbsp;
&lt;br&gt;See the section ahead about defining data objects functions to learn &amp;nbsp;
&lt;br&gt;how to declare and use this type of functions.'
&lt;br&gt;&lt;br&gt;How can i create object user and profile and set references in a form &amp;nbsp;
&lt;br&gt;of 1-to-1 relationship? Like this?
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;function&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;setprofileid&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;setreference&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;parameters&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;profile_id&amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;reference&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;argument&amp;gt;profile&amp;lt;/argument&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/reference&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/parameters&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/function&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;function&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;setuserid&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;type&amp;gt;setreference&amp;lt;/type&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;parameters&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;variable&amp;gt;user_id&amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;reference&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;argument&amp;gt;user&amp;lt;/argument&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/reference&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/parameters&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/function&amp;gt;
&lt;br&gt;&lt;br&gt;Also, should i call these functions before persist the database?
&lt;br&gt;&lt;br&gt;Thanks in advance,
&lt;br&gt;&lt;br&gt;regards,
&lt;br&gt;miguel
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/setreference-for-foreign-keys-in-1-to-1-relationshipship-tp15612644p15612644.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-15538831</id>
	<title>Re: metastorage: how to set an unique one-to-one relation between two classes</title>
	<published>2008-02-17T20:21:56Z</published>
	<updated>2008-02-17T20:21:56Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;on 02/17/2008 11:05 AM Miguel Oliveira said the following:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I've started using metastorage and create my component to generate &amp;nbsp;
&lt;br&gt;&amp;gt; the db schema:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;&amp;lt;class&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;users&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ....
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;lt;variable&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;profile_id&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;profiles&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;/class&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; also,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;&amp;lt;class&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;profile&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ....
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;lt;variable&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;user_id&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;users&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;/class&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Webstorage generate the output schema and manipulation files and &amp;nbsp;
&lt;br&gt;&amp;gt; further, metastorage create the db.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; My doubt consists in this: When adding a new user record it should &amp;nbsp;
&lt;br&gt;&amp;gt; have an associated profile(mandatory). The fields user_id and &amp;nbsp;
&lt;br&gt;&amp;gt; profile_id in database are not defined as 'not null' as i think they &amp;nbsp;
&lt;br&gt;&amp;gt; suppose to be.
&lt;/div&gt;&lt;br&gt;Yes, I was trying to remember what was the exact reasoning to not make
&lt;br&gt;reference variables not null, but I am not sure.
&lt;br&gt;&lt;br&gt;I know that some databases require that not null fields have an explicit
&lt;br&gt;default value to override the NULL default value. I guess I could make
&lt;br&gt;the default 0 even though it will never be used for non-optional variables.
&lt;br&gt;&lt;br&gt;Anyway, for now you do not need to be concerned because if for some
&lt;br&gt;reason your application is not setting a reference variable to an
&lt;br&gt;existing object, the class persist function will fail telling you that
&lt;br&gt;the variable needs to be initialized.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; Is in metabase any way to make those fields 'not null'? I've seen &amp;nbsp;
&lt;br&gt;&amp;gt; documentation regarding to references, getreference, setreference but &amp;nbsp;
&lt;br&gt;&amp;gt; i'm not sure if this should be used or not.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Because i'll need to check user settings and access policy, should i &amp;nbsp;
&lt;br&gt;&amp;gt; create functions to get id's in the component?
&lt;br&gt;&lt;br&gt;By default all variables are non-optional (NOT NULL), so you need to
&lt;br&gt;initialize them to some value. If you want to make a variable accept
&lt;br&gt;NULL, you need to set the &amp;lt;optional&amp;gt;1&amp;lt;/optional&amp;gt; parameter of the
&lt;br&gt;variable definition.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;PHP professionals looking for PHP jobs
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/professionals/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/professionals/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/metastorage%3A-how-to-set-an-unique-one-to-one-relation-between-two-classes-tp15533725p15538831.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-15533725</id>
	<title>metastorage: how to set an unique one-to-one relation between two classes</title>
	<published>2008-02-17T06:05:03Z</published>
	<updated>2008-02-17T06:05:03Z</updated>
	<author>
		<name>Miguel Oliveira-3</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;I've started using metastorage and create my component to generate &amp;nbsp;
&lt;br&gt;the db schema:
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;lt;class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;users&amp;lt;/name&amp;gt;
&lt;br&gt;&lt;br&gt;....
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;profile_id&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;profiles&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;lt;/class&amp;gt;
&lt;br&gt;&lt;br&gt;also,
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;lt;class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;name&amp;gt;profile&amp;lt;/name&amp;gt;
&lt;br&gt;&lt;br&gt;....
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;variable&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;name&amp;gt;user_id&amp;lt;/name&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;class&amp;gt;users&amp;lt;/class&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/variable&amp;gt;
&lt;br&gt;&amp;lt;/class&amp;gt;
&lt;br&gt;&lt;br&gt;Webstorage generate the output schema and manipulation files and &amp;nbsp;
&lt;br&gt;further, metastorage create the db.
&lt;br&gt;&lt;br&gt;My doubt consists in this: When adding a new user record it should &amp;nbsp;
&lt;br&gt;have an associated profile(mandatory). The fields user_id and &amp;nbsp;
&lt;br&gt;profile_id in database are not defined as 'not null' as i think they &amp;nbsp;
&lt;br&gt;suppose to be.
&lt;br&gt;&lt;br&gt;Is in metabase any way to make those fields 'not null'? I've seen &amp;nbsp;
&lt;br&gt;documentation regarding to references, getreference, setreference but &amp;nbsp;
&lt;br&gt;i'm not sure if this should be used or not.
&lt;br&gt;&lt;br&gt;Because i'll need to check user settings and access policy, should i &amp;nbsp;
&lt;br&gt;create functions to get id's in the component?
&lt;br&gt;&lt;br&gt;regards,
&lt;br&gt;miguel
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/metastorage%3A-how-to-set-an-unique-one-to-one-relation-between-two-classes-tp15533725p15533725.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-15513821</id>
	<title>Nested component transactions</title>
	<published>2008-02-15T17:48:31Z</published>
	<updated>2008-02-15T17:48:31Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;I have not made many Metastorage releases recently but I made some
&lt;br&gt;developments in Metabase that provide flexibility to Metastorage
&lt;br&gt;generated components.
&lt;br&gt;&lt;br&gt;Some applications may need to use classes of multiple components at the
&lt;br&gt;same time, like for instance a blog component may use a forum component
&lt;br&gt;to implement blog comments.
&lt;br&gt;&lt;br&gt;However, if both components start transactions, previously Metabase
&lt;br&gt;would fail complaining that a transaction was already started when the
&lt;br&gt;second component starts the transaction.
&lt;br&gt;&lt;br&gt;In the latest revision of Metastorage, nested transactions are allowed.
&lt;br&gt;This means that when the second component starts a transaction, nothing
&lt;br&gt;happens, the transaction started by the first continues.
&lt;br&gt;&lt;br&gt;When the second component ends a transaction, with either a commit or a
&lt;br&gt;rollback implemented by a factory function of type finishtransaction,
&lt;br&gt;nothing happens either. The transaction is only ended when the outer
&lt;br&gt;component finishes the transaction.
&lt;br&gt;&lt;br&gt;Note that if an inner component requests to end a transaction by
&lt;br&gt;commiting it, the outer component must also do the same consistently,
&lt;br&gt;ie. request to commit the transaction. Likewise, if the inner component
&lt;br&gt;request to rollback the transaction, the outer component must also
&lt;br&gt;rollback the transaction.
&lt;br&gt;&lt;br&gt;Otherwise, Metabase will fail with an error and the transaction is
&lt;br&gt;always rolled back because partial transactions are not supported and so
&lt;br&gt;there is a consistency bug in your application.
&lt;br&gt;&lt;br&gt;If you never have mixed multiple components in an application, never
&lt;br&gt;mind, you do not need to worry about these details.
&lt;br&gt;&lt;br&gt;For now, the version of Metabase that supports nested transactions is
&lt;br&gt;available only from CVS:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.meta-language.net/download.html#snapshots&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.meta-language.net/download.html#snapshots&lt;/a&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;PHP professionals looking for PHP jobs
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/professionals/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/professionals/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Nested-component-transactions-tp15513821p15513821.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-12783289</id>
	<title>Object cloning</title>
	<published>2007-09-19T12:19:40Z</published>
	<updated>2007-09-19T12:19:40Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;A new version of Metastorage was released to introduce a new capability
&lt;br&gt;of creating copies of existing persistent objects. Other minor features
&lt;br&gt;and bug fixes were made available with this release.
&lt;br&gt;&lt;br&gt;Here is the complete news announcement:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.meta-language.net/news-2007-09-19-metastorage.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.meta-language.net/news-2007-09-19-metastorage.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;Metastorage - Data object relational mapping layer generator
&lt;br&gt;&lt;a href=&quot;http://www.metastorage.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.metastorage.net/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Object-cloning-tp12783289p12783289.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-11047367</id>
	<title>createobject forms with variables of types boolean, integer, decimal, float</title>
	<published>2007-06-10T04:03:49Z</published>
	<updated>2007-06-10T04:03:49Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Add support to createobject forms for classes with variables of types boolean, integer, decimal, float. 
&lt;br&gt;&lt;br&gt;q 
&lt;br&gt;&lt;br&gt;___
&lt;br&gt;Source: #createobject-form-variable-boolean-integer-decimal-float 
&lt;br&gt;--
&lt;br&gt;To unsubscribe from [1]this feed, click [2]here
&lt;br&gt;To manage other subscriptions, click [3]here
&lt;br&gt;~
&lt;br&gt;Powered by [4]RssFwd
&lt;br&gt;Hosting sponsored by [5]Publicaster - Powerful Email Marketing Solutions by [6]Blue Sky Factory, Inc
&lt;br&gt;&lt;br&gt;[1] &amp;lt;&lt;a href=&quot;http://www.meta-language.net/metastorage-progress.xml&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.meta-language.net/metastorage-progress.xml&lt;/a&gt;&amp;gt;
&lt;br&gt;[2] &amp;lt;&lt;a href=&quot;http://www.rssfwd.com/rssfwd/unsubscribe?id=228690&amp;email=metal-dev%40yahoogroups.com&amp;genpass=7e25e0d540849adc7d6e477da136bc98&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.rssfwd.com/rssfwd/unsubscribe?id=228690&amp;email=metal-dev%40yahoogroups.com&amp;genpass=7e25e0d540849adc7d6e477da136bc98&lt;/a&gt;&amp;gt;
&lt;br&gt;[3] &amp;lt;&lt;a href=&quot;http://www.rssfwd.com/rssfwd/opml/metal-dev%40yahoogroups.com;7e25e0d540849adc7d6e477da136bc98&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.rssfwd.com/rssfwd/opml/metal-dev%40yahoogroups.com;7e25e0d540849adc7d6e477da136bc98&lt;/a&gt;&amp;gt;
&lt;br&gt;[4] &amp;lt;&lt;a href=&quot;http://www.rssfwd.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.rssfwd.com/&lt;/a&gt;&amp;gt;
&lt;br&gt;[5] &amp;lt;&lt;a href=&quot;http://www.blueskyfactory.com/bsflanding/landing_pubrss/pubrss.htm&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.blueskyfactory.com/bsflanding/landing_pubrss/pubrss.htm&lt;/a&gt;&amp;gt;
&lt;br&gt;[6] &amp;lt;&lt;a href=&quot;http://www.blueskyfactory.com/bsflanding/landing_pubrss/pubrss.htm&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.blueskyfactory.com/bsflanding/landing_pubrss/pubrss.htm&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/createobject-forms-with-variables-of-types-boolean%2C-integer%2C-decimal%2C-float-tp11047367p11047367.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-11045991</id>
	<title>Confirmation for email subscription</title>
	<published>2007-06-09T23:16:29Z</published>
	<updated>2007-06-09T23:16:29Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">You have recently subscribed to receive email updates for 'Metastorage project progress' &lt;a href=&quot;http://www.meta-language.net/metastorage-progress.xml&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.meta-language.net/metastorage-progress.xml&lt;/a&gt;&lt;br&gt;&lt;br&gt;This subscription was subscribed with the email address: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=11045991&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;metal-dev@...&lt;/a&gt;. As a security measure, you will need to confirm your subscription before RssFwd can enable your subscription to 'Metastorage project progress'.
&lt;br&gt;&lt;br&gt;&lt;br&gt;To confirm your subscription, please visit this url: &lt;a href=&quot;http://www.rssfwd.com/rssfwd/confirm_email?id=228690&amp;email=metal-dev%40yahoogroups.com&amp;genpass=7e25e0d540849adc7d6e477da136bc98&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.rssfwd.com/rssfwd/confirm_email?id=228690&amp;email=metal-dev%40yahoogroups.com&amp;genpass=7e25e0d540849adc7d6e477da136bc98&lt;/a&gt;&lt;br&gt;&lt;br&gt;If you have received this several times or suspect that someone may be spam-ing you, please forward this email to &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=11045991&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;choonkeat@...&lt;/a&gt; - we'll contact the owner of 'Metastorage project progress'.
&lt;br&gt;&lt;br&gt;Otherwise, please ignore this email. DO NOT REPLY THIS E-MAIL.
&lt;br&gt;&lt;br&gt;---
&lt;br&gt;Powered by RssFwd
&lt;br&gt;&lt;a href=&quot;http://www.rssfwd.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.rssfwd.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Confirmation-for-email-subscription-tp11045991p11045991.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-9606522</id>
	<title>Re: Re: Custom Identifier - how does it work?</title>
	<published>2007-03-21T18:44:07Z</published>
	<updated>2007-03-21T18:44:07Z</updated>
	<author>
		<name>mlemos</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;on 03/21/2007 05:17 AM manfred.schreck said the following:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; --- In &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=9606522&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;metal-dev@...&lt;/a&gt;, Manuel Lemos &amp;lt;mlemos@...&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; on 03/20/2007 05:32 AM manfred.schreck said the following:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I am using Metabase for a while, and I am happy with it.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Now I am in a situation, that I have to use a custom identifier. 
&lt;br&gt;&amp;gt; The 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; scenario is that I use Metabase to synchronize data between 
&lt;br&gt;&amp;gt; existing 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; db/php app and a newly created web application. The existing app 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; cannot be changed, and a table containing user information has a 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; login filed as the primary key. An id field cannot be added.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Now my question: How can I get Metabase to work with a field 
&lt;br&gt;&amp;gt; login 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; insted of id? 
&lt;br&gt;&amp;gt;&amp;gt; I am a bit confused with your references to Metabase.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Do you mean you have an application using Metabase and you want to
&lt;br&gt;&amp;gt;&amp;gt; integrate with something that uses classes generated by 
&lt;br&gt;&amp;gt; Metastorage?
&lt;/div&gt;&lt;br&gt;&amp;gt; sorry I meant Metastorage.
&lt;br&gt;&lt;br&gt;Currently Metastorage does not support defining custom object identifier
&lt;br&gt;(OID) variables. For now, an implicit OID is assigned to automatic
&lt;br&gt;variable id .
&lt;br&gt;&lt;br&gt;However it is already in my todo list to add support custom OID. Not
&lt;br&gt;only you will be specify another variable as OID, but you also be
&lt;br&gt;allowed to specify more than one OID variable to achieve composite
&lt;br&gt;primary keys. Please be patient.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Manuel Lemos
&lt;br&gt;&lt;br&gt;Metastorage - Data object relational mapping layer generator
&lt;br&gt;&lt;a href=&quot;http://www.metastorage.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.metastorage.net/&lt;/a&gt;&lt;br&gt;&lt;br&gt;PHP Classes - Free ready to use OOP components written in PHP
&lt;br&gt;&lt;a href=&quot;http://www.phpclasses.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.phpclasses.org/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Custom-Identifier---how-does-it-work--tp9578074p9606522.html" />
</entry>

</feed>
