This commit is contained in:
2021-02-25 17:25:30 +08:00
parent 2f1e4235c6
commit e1fa0a6b12
3 changed files with 16 additions and 19 deletions
+3 -4
View File
@@ -190,10 +190,9 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
/**
* @throws Exception
*/
public function hasAutoIncrement(): bool
public function isAutoIncrement(): bool
{
$autoIncrement = $this->getAutoIncrement();
return $autoIncrement !== null;
return $this->getAutoIncrement() !== null;
}
/**
@@ -434,7 +433,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
*/
private function setPrimary($lastId, $param): static
{
if ($this->hasAutoIncrement()) {
if ($this->isAutoIncrement()) {
$this->setAttribute($this->getAutoIncrement(), (int)$lastId);
return $this;
}