Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

moved build criteria

  • Loading branch information...
commit 4481b86fd344b30c5173a3f5198ac8781e306386 1 parent 8391211
@mpscholten authored
View
14 src/Propel/Generator/Builder/Om/templates/Object/_buildCriteria.php.twig
@@ -0,0 +1,14 @@
+/**
+ * Build a Criteria object containing the values of all modified columns in this object.
+ *
+ * @return Criteria The Criteria object containing all modified values.
+ */
+public function buildCriteria()
+{
+ $criteria = new Criteria({{ builder.tableMapClassName }}::DATABASE_NAME);
+ {% for column in builder.table.columns %}
+ if ($this->isColumnModified({{ builder.columnConstant(column) }})) $criteria->add({{ builder.columnConstant(column) }}, $this->{{ column.name|lower }});
+ {% endfor %}
+
+ return $criteria;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.