public function addField($field, $their_field = null)
{
if (is_array($field)) {
$defaults = $field;
if (!isset($defaults[0])) {
throw Exception('Field name must be specified', ['field' => $field]);
}
$field = $defaults[0];
} else {
$defaults = [];
}
if ($their_field === null) {
$their_field = $field;
}
$e = $this->owner->addExpression($field, array_merge([function ($m) use($their_field) {
return $m->refLink($this->link)->action('field', [$their_field]);
}], $defaults));
return $e;
}