protected function _publicIp($from, $to, $action)
{
switch ($action) {
case static::ACT_CONVERT_TO_OBJECT:
/* @var $from Server */
$to->publicIp = empty($from->remoteIp) ? [] : [$from->remoteIp];
break;
case static::ACT_CONVERT_TO_ENTITY:
/* @var $to Server */
$to->remoteIp = empty($from->publicIp) ? null : reset($from->publicIp);
break;
case static::ACT_GET_FILTER_CRITERIA:
return [['remoteIp' => reset($from->publicIp)]];
}
}