Skip to content

Commit

Permalink
Merge pull request #341 from avbdr/master
Browse files Browse the repository at this point in the history
fixes
  • Loading branch information
avbdr committed Oct 15, 2015
2 parents 531957a + 44c8895 commit b626255
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dbObject.php
Expand Up @@ -186,7 +186,7 @@ public function __unset ($name) {
*/
private function JsonBuilder () {
$this->returnType = 'Json';
return $this;
return $return;
}

/**
Expand Down Expand Up @@ -233,7 +233,7 @@ public function insert () {
return false;

$id = $this->db->insert ($this->dbTable, $sqlData);
if (!empty ($this->primaryKey) && !isset($this->data[$this->primaryKey]))
if (!empty ($this->primaryKey) && empty ($this->data[$this->primaryKey]))
$this->data[$this->primaryKey] = $id;
$this->isNew = false;

Expand Down
2 changes: 1 addition & 1 deletion readme.md
Expand Up @@ -126,7 +126,7 @@ $data = Array ("login" => "admin",
"createdAt" => $db->now(),
"updatedAt" => $db->now(),
);
$updateColumns = Array ("updateAt");
$updateColumns = Array ("updatedAt");
$lastInsertId = "id";
$db->onDuplicate($updateColumns, $lastInsertId);
$id = $db->insert ('users', $data);
Expand Down

0 comments on commit b626255

Please sign in to comment.