<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Duplicating a propel object</title>
	<atom:link href="http://pablogodel.com/2009/04/20/duplicating-a-propel-object/feed/" rel="self" type="application/rss+xml" />
	<link>http://pablogodel.com/2009/04/20/duplicating-a-propel-object/</link>
	<description>Software Development / Sailing / Photography / House Music</description>
	<lastBuildDate>Sun, 07 Mar 2010 11:19:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Michele</title>
		<link>http://pablogodel.com/2009/04/20/duplicating-a-propel-object/#comment-152</link>
		<dc:creator>Michele</dc:creator>
		<pubDate>Sun, 07 Mar 2010 11:19:13 +0000</pubDate>
		<guid isPermaLink="false">http://pablogodel.com/?p=9#comment-152</guid>
		<description>Great DAVID!
You saved me some hours of work. :-)
Thanks.</description>
		<content:encoded><![CDATA[<p>Great DAVID!<br />
You saved me some hours of work. <img src='http://pablogodel.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ronald</title>
		<link>http://pablogodel.com/2009/04/20/duplicating-a-propel-object/#comment-151</link>
		<dc:creator>ronald</dc:creator>
		<pubDate>Tue, 02 Mar 2010 13:52:37 +0000</pubDate>
		<guid isPermaLink="false">http://pablogodel.com/?p=9#comment-151</guid>
		<description>I found some thing that works better, using propel&#039;s built in functionality

$objCopy = null;
$objCopy = $objRow-&gt;copy();
$objCopy-&gt;setName(&quot;foo&quot;);
$objCopy-&gt;save();</description>
		<content:encoded><![CDATA[<p>I found some thing that works better, using propel&#8217;s built in functionality</p>
<p>$objCopy = null;<br />
$objCopy = $objRow-&gt;copy();<br />
$objCopy-&gt;setName(&#8220;foo&#8221;);<br />
$objCopy-&gt;save();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fernando</title>
		<link>http://pablogodel.com/2009/04/20/duplicating-a-propel-object/#comment-27</link>
		<dc:creator>Fernando</dc:creator>
		<pubDate>Wed, 08 Jul 2009 00:29:11 +0000</pubDate>
		<guid isPermaLink="false">http://pablogodel.com/?p=9#comment-27</guid>
		<description>Great Job, effort like this, makes symfony so useful ...

thanks</description>
		<content:encoded><![CDATA[<p>Great Job, effort like this, makes symfony so useful &#8230;</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://pablogodel.com/2009/04/20/duplicating-a-propel-object/#comment-4</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Mon, 20 Apr 2009 20:45:19 +0000</pubDate>
		<guid isPermaLink="false">http://pablogodel.com/?p=9#comment-4</guid>
		<description>Be careful with deepCopy when I used it I remember being surprised a couple of times.

I also recall that there seemed to be an issue with multiple field primary keys as well

My bug report here:
http://trac.symfony-project.org/ticket/4836

It&#039;s unreviewed, which may be a nice way of saying I was doing something else wrong ;)</description>
		<content:encoded><![CDATA[<p>Be careful with deepCopy when I used it I remember being surprised a couple of times.</p>
<p>I also recall that there seemed to be an issue with multiple field primary keys as well</p>
<p>My bug report here:<br />
<a href="http://trac.symfony-project.org/ticket/4836" rel="nofollow">http://trac.symfony-project.org/ticket/4836</a></p>
<p>It&#8217;s unreviewed, which may be a nice way of saying I was doing something else wrong <img src='http://pablogodel.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pablo</title>
		<link>http://pablogodel.com/2009/04/20/duplicating-a-propel-object/#comment-3</link>
		<dc:creator>Pablo</dc:creator>
		<pubDate>Mon, 20 Apr 2009 20:16:50 +0000</pubDate>
		<guid isPermaLink="false">http://pablogodel.com/?p=9#comment-3</guid>
		<description>@David

great, this is what I needed, I could not find it quickly.

thanks!</description>
		<content:encoded><![CDATA[<p>@David</p>
<p>great, this is what I needed, I could not find it quickly.</p>
<p>thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://pablogodel.com/2009/04/20/duplicating-a-propel-object/#comment-2</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 20 Apr 2009 19:49:07 +0000</pubDate>
		<guid isPermaLink="false">http://pablogodel.com/?p=9#comment-2</guid>
		<description>There is actually something ready to use in Propel: in your Model&#039;s base class you can find the following:
[code]
	/**
	 * Makes a copy of this object that will be inserted as a new row in table when saved.
	 * It creates a new object filling in the simple attributes, but skipping any primary
	 * keys that are defined for the table.
	 *
	 * If desired, this method can also make copies of all associated (fkey referrers)
	 * objects.
	 *
	 * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
	 * @return     Contract Clone of current object.
	 * @throws     PropelException
	 */
	public function copy($deepCopy = false)
	{
		// we use get_class(), because this might be a subclass
		$clazz = get_class($this);
		$copyObj = new $clazz();
		$this-&gt;copyInto($copyObj, $deepCopy);
		return $copyObj;
	}
[/code]</description>
		<content:encoded><![CDATA[<p>There is actually something ready to use in Propel: in your Model&#8217;s base class you can find the following:<br />
[code]<br />
	/**<br />
	 * Makes a copy of this object that will be inserted as a new row in table when saved.<br />
	 * It creates a new object filling in the simple attributes, but skipping any primary<br />
	 * keys that are defined for the table.<br />
	 *<br />
	 * If desired, this method can also make copies of all associated (fkey referrers)<br />
	 * objects.<br />
	 *<br />
	 * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.<br />
	 * @return     Contract Clone of current object.<br />
	 * @throws     PropelException<br />
	 */<br />
	public function copy($deepCopy = false)<br />
	{<br />
		// we use get_class(), because this might be a subclass<br />
		$clazz = get_class($this);<br />
		$copyObj = new $clazz();<br />
		$this-&gt;copyInto($copyObj, $deepCopy);<br />
		return $copyObj;<br />
	}<br />
[/code]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
