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

_farmRole() protected method

protected _farmRole ( $from, $to, $action )
    protected function _farmRole($from, $to, $action)
    {
        switch ($action) {
            case static::ACT_CONVERT_TO_OBJECT:
                /* @var $from Server */
                $to->farmRole = ['id' => $from->farmRoleId];
                break;
            case static::ACT_CONVERT_TO_ENTITY:
                /* @var $to Server */
                $to->farmRoleId = ApiController::getBareId($from, 'farmRole');
                break;
            case static::ACT_GET_FILTER_CRITERIA:
                return [['farmRoleId' => ApiController::getBareId($from, 'farmRole')]];
        }
    }