/** * {@inheritdoc} */ public function updateSelection(UpdateSelectionBuilder $selection) { if (!isset($this->join)) { return $this->other->updateSelection($selection->where($this->thisKey . ' = ?', $this->recordId)); } $sets = $selection->sets; $read = $this->prepareSelection($selection->toSelection()); $num = 0; foreach ($read->select($this->otherPrimary) as $otherId) { $num++; $this->other->where($this->otherPrimary . ' = ?', $otherId)->set($sets)->updateSelection(); } return $num; }
/** * {@inheritdoc} */ public function set($column, $value = null) { $selection = new UpdateSelectionBuilder($this); return $selection->set($column, $value); }