public function setScript(AbstractScript $script)
{
parent::setScript($script);
// FIXME: can we throw away toArray cast?
$source = $script->toArray();
if ($script->hasUpsert()) {
$upsert = $script->getUpsert()->getData();
if (!empty($upsert)) {
$source['upsert'] = $upsert;
}
}
$this->setSource($source);
return $this;
}