Note that there are some explanatory texts on larger screens.

plurals
  1. POPropel method update is undefined?
    primarykey
    data
    text
    <p>I'm trying to run the following code:</p> <pre><code>$post = PostQuery::create() -&gt;findPk($id); $post-&gt;update($params); </code></pre> <p>The method is taken from <a href="http://propelorm.org/documentation/03-basic-crud.html" rel="nofollow">http://propelorm.org/documentation/03-basic-crud.html</a>, but I receice an error:</p> <blockquote> <p>Fatal error: Uncaught exception 'PropelException' with message 'Call to undefined method: update' in /usr/share/php/propel/om/BaseObject.php:426</p> </blockquote> <p>What could I've done wrong in this case? I can delete successfully with the delete-method using in the same way:</p> <pre><code>$post = PostQuery::create() -&gt;findPK($id); $post-&gt;delete(); </code></pre> <hr> <p><strong>Update</strong></p> <p>I tried the mentioned solutions, the first one works well, but not the second one.</p> <pre><code>$post = PostQuery::create() -&gt;filterById($id) -&gt;update($params); </code></pre> <p>This now throws another error</p> <blockquote> <p>Fatal error: Uncaught exception 'PropelException' with message 'Cannot fetch ColumnMap for undefined column phpName: id' in /usr/share/php/propel/map/TableMap.php:384</p> </blockquote> <p>although the schema.xml looks correct to me:</p> <pre><code> &lt;table name="post" phpName="Post" idMethod="native"&gt; &lt;column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/&gt; </code></pre> <p>I don't know what could be the problem here as I am able to fetch the id by using the find()-method and</p> <pre><code>$post-&gt;getId(); </code></pre> <p>while looping through.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload