azure-storage-table/src/Table/Models/EdmType.php
public static function serializeValue($type, $value)
    {
        switch ($type) {
        case null:
            return $value;

        case EdmType::INT32:
            return intval($value);

        case EdmType::INT64:
        case EdmType::GUID:
        case EdmType::STRING:
            return strval($value);

        case EdmType::DOUBLE:
            return strval($value);

        case EdmType::BINARY:
            return base64_encode($value);

        case EdmType::DATETIME:
            return Utilities::convertToEdmDateTime($value);

        case EdmType::BOOLEAN:
            return (is_null($value) ? '' : ($value == true ? true : false));

        default:
            throw new \InvalidArgumentException();
        }
    }
public static function serializeValue($type, $value)
    {
        switch ($type) {
        case null:
            return $value;

        case EdmType::INT32:
            return intval($value);

        case EdmType::INT64:
        case EdmType::GUID:
        case EdmType::STRING:
            return strval($value);

        case EdmType::DOUBLE:
            return strval($value);

        case EdmType::BINARY:
            return base64_encode($value);

        case EdmType::DATETIME:
            return Utilities::convertToEdmDateTime($value);

        case EdmType::BOOLEAN:
            return (is_null($value) ? '' : ($value == true ? true : false));

        default:
            throw new \InvalidArgumentException();
        }
    }
Serializes EDM value into proper value for sending it to Windows Azure.

@param string $type  The EDM type.
@param mixed  $value The EDM value.

@internal

@return string

@throws \InvalidArgumentException