for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Win\Repositories\Database\Sql\Builders;
use Win\Repositories\Database\Sql\Builder;
/**
* UPDATE ... SET ...
*/
class Update extends Builder
{
public function __toString()
return 'UPDATE ' . $this->query->table
. ' SET ' . $this->set()
. $this->query->where
. $this->query->limit;
}
/** @return string */
protected function set()
return implode(', ', array_map(function ($column) {
return $column . ' = ?';
}, array_keys($this->query->values)));
public function getValues()
return array_merge(
$this->query->values,
$this->query->where->values
);