*/ private ?array $set; private string $where = ''; /** * @internal */ public function __construct( private readonly QueryBuilder $sql, private readonly string $table, ) { } /** * @param array $set */ public function set(array $set): self { $this->set = $set; return $this; } public function where(string $where): self { $this->where = $where; return $this; } /** * @param array $params */ public function execute(array $params = []): void { $this->sql->_executeUpdate($this, $params); } /** * @internal */ public function _getTable(): string { return $this->table; } /** * @internal */ public function _getWhere(): string { return $this->where; } /** * @internal * @return array */ public function _getSet(): array { if (!isset($this->set)) { throw new InvalidSqlException('UPDATE: $set must be set before calling execute()'); } return $this->set; } }