Scalr\Api\Service\User\V1beta0\Adapter\ServerAdapter::_publicIp PHP Method

_publicIp() protected method

protected _publicIp ( $from, $to, $action )
    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)]];
        }
    }