$weblink = $modx->newObject('modWeblink', $fields);
$weblink->save();This question has been answered by BobRay. See the first response.
$webLink = $modx->getObject('modWebLink', 64);
if ($webLink) {
$webLink->setContent('http://some/url');
$webLink->save();
} else {
/* failed to retrieve Weblink */
}$webLink->set('content, 'http://some/url');$cm = $modx->getCacheManager(); $cm->refresh();
unlink(MODX_CORE_PATH . /cache/path/to/weblink/cache/file);
$webLink->setContent(MODX_SITE_URL . 'remaining/url/');
If that doesn't work (it should) try this:
$webLink->set('content, 'http://some/url');

$weblink = $modx->newObject('modWebLink', $fields);
$weblink->save();$fields = array(
'pagetitle' =>$pagetitle,
'content' =>$clickout,
'parent' =>'90',
'published' =>'1',
'alias' =>$alias,
'unpub_date' =>$unpub_date,
'searchable' =>'0'
);$weblink->fromArray($fields); $weblink->save();
public function setContent($content, array $options = array()) {
return $this->set('content', $content);
}$weblink = $modx->newObject('modWebLink', $fields);void fromArray( array $fldarray, [string $keyPrefix = ''], [boolean $setPrimaryKeys = false], [boolean $rawValues = false], [boolean $adhocValues = false] )