private static function canBeSerializedAsValue($object)
    {
        $result = true;
        self::traverse(false, $object, function ($obj) use (&$result)
        {
            // short circuit as soon as possible.
            if ($result === false)
            {
                return;
            }
            // cannot make a pointer to an unsaved object.
            if ($obj instanceof AVObject)
            {
                if (!$obj->getObjectId())
                {
                    $result = false;

                    return;
                }
            }
        });

        return $result;
    }