Skip to content

Commit

Permalink
Merge pull request #61 from rotorom/use-schema-in-model-delete-and-patch
Browse files Browse the repository at this point in the history
Update Model's delete and patch to use schema
  • Loading branch information
nohponex committed Sep 5, 2017
2 parents 518fa38 + e65e010 commit bd29949
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,14 @@ public static function patch($id, $attributes)
return \Phramework\Database\Operations\Update::update(
$id,
(array) $attributes,
static::getTable(),
(
static::getSchema() === null
? static::getTable()
: [
'table' => static::getTable(),
'schema' => static::getSchema()
]
),
static::getIdAttribute()
);
}
Expand All @@ -190,7 +197,14 @@ public static function delete($id, $additionalAttributes = null)
? (array) $additionalAttributes
: []
),
static::getTable(),
(
static::getSchema() === null
? static::getTable()
: [
'table' => static::getTable(),
'schema' => static::getSchema()
]
),
static::getIdAttribute()
);
}
Expand Down

0 comments on commit bd29949

Please sign in to comment.