This commit is contained in:
2021-03-08 14:43:52 +08:00
parent 8add053094
commit c45665c1fd
3 changed files with 33 additions and 10 deletions
+1 -8
View File
@@ -12,8 +12,6 @@ namespace Database\Base;
use Annotation\Event;
use Annotation\Inject;
use Annotation\Model\Get;
use Annotation\Model\Set;
use ArrayAccess;
use Database\SqlBuilder;
use Database\Traits\HasBase;
@@ -75,8 +73,6 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
private array $_annotations = [];
private array $_fields = [];
/**
* @var bool
*/
@@ -756,10 +752,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
*/
public function has($attribute): bool
{
if (empty($this->_fields)) {
$this->_fields = static::getColumns()->format();
}
return isset($this->_fields[$attribute]);
return static::getColumns()->hasField($attribute);
}
/**ƒ