This commit is contained in:
2022-10-10 16:46:44 -03:00
parent 422d9a6dbd
commit 0a9bed1735
2 changed files with 2 additions and 2 deletions

View File

@ -78,7 +78,7 @@ abstract class Model implements ModelInterface
if ($method->getName() === 'getRepository') { if ($method->getName() === 'getRepository') {
continue; continue;
} }
$p = strtolower(str_replace('get', '', $method->getName())); $p = strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', str_replace('get', '', $method->getName())));
if (!isset($this->{$p})) { if (!isset($this->{$p})) {
continue; continue;
} }

View File

@ -277,7 +277,7 @@ abstract class Repository implements RepositoryInterface
$values = $this->mapArray($model, []); $values = $this->mapArray($model, []);
$cols = array_fill(0, count($values), '?'); $cols = array_fill(0, count($values), '?');
$query = $this->getQueryBuilder()->insert($this->getTable())->columns($this->getColumns())->values($cols); $query = $this->getQueryBuilder()->insert($this->getTable())->columns($this->getColumns())->values($cols);
$this->getConnection()->execute($query, $values); $this->getConnection()->execute($query, array_values($values));
} }
public function update(Model $model): void public function update(Model $model): void
{ {