コード例 #1
0
 public function format()
 {
     $table = $this->formatterProvider->delimite($this->updateQuery->getTable());
     $update = $this->updateQuery->getParameterList();
     $set = [];
     $parameterList = [];
     foreach ($update as $key => $value) {
         $parameterList[$keyId = sha1($key)] = $value;
         $key = $this->formatterProvider->delimite($key);
         $set[$key] = $key . ' = :' . $keyId;
     }
     $whereFragment = $this->updateQuery->getWhere()->format($this->formatterProvider);
     return $this->sql(sprintf('UPDATE %s SET %s WHERE %s', $table, implode(', ', $set), $whereFragment), array_merge($parameterList, $whereFragment->getParameterList()));
 }
コード例 #2
0
 protected function update(IStorable $storable, array $store)
 {
     $query = new UpdateQuery($storable->schema()->getName(), $store, $this->whereIdentifier($storable->guid()));
     $query->add($this->createPrimaryProperty()->getName(), $storable->guid());
     $this->exec($query);
 }