Skip to content

Commit

Permalink
fixed more bugs and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Philip Scholten committed Oct 9, 2013
1 parent 2f4b818 commit 0af0fc8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
Expand Up @@ -12,7 +12,7 @@ public function buildPkeyCriteria()
{
$criteria = new Criteria({{ builder.tableMapClassName }}::DATABASE_NAME);
{% for column in builder.table.primaryKey %}
$criteria->add({{ builder.columnConstant(column) }}, $this->{{ column.name|lower }});";
$criteria->add({{ builder.columnConstant(column) }}, $this->{{ column.name|lower }});
{% endfor %}

return $criteria;
Expand Down
Expand Up @@ -68,7 +68,7 @@ public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
$copyObj->setNew(true);
{% for column in builder.table.columns %}
{% if column.autoIncrement %}
$copyObj->set{{ column.phpName }}({{ builder.defaultValueString }}); // this is a auto-increment column, so set to default value
$copyObj->set{{ column.phpName }}({{ builder.defaultValueString(column) }}); // this is a auto-increment column, so set to default value
{% endif %}
{% endfor %}
}
Expand Down
Expand Up @@ -15,9 +15,10 @@
* @param string $keyType The type of keys the array uses.
* @return void
*/
public function fromArray($arr, $keyType = TableMap::$defaultKeyType)
public function fromArray($arr, $keyType = TableMap::{{ builder.defaultKeyType }})
{
$keys = {{ builder.tableMapClassName }}::getFieldNames($keyType);
{% for column in builder.table.columns %}
if (array_key_exists($keys[{{ loop.index0 }}], $arr)) $this->set{{ column.phpName }}($arr[$keys[{{ loop.index0 }}]]);
{% endfor %}
}
Expand Up @@ -18,7 +18,7 @@
public function getPrimaryKey()
{
$pks = array();
{% for primaryKey in builder.table.primaryKeys %}
{% for primaryKey in primaryKeys %}
$pks[{{ loop.index0 }}] = $this->get{{ primaryKey.phpName }}();
{% endfor %}

Expand Down
Expand Up @@ -20,8 +20,8 @@
*/
public function setPrimaryKey($keys)
{
{% for primaryKey in builder.table.primaryKeys %}
$this->set{{ primaryKey.phpName }}($keys[{{ loop.index0 }}]);";
{% for primaryKey in primaryKeys %}
$this->set{{ primaryKey.phpName }}($keys[{{ loop.index0 }}]);
{% endfor %}
}
{% else %}
Expand Down

0 comments on commit 0af0fc8

Please sign in to comment.