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;
    }
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;
    }
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 ; }
Checks the given object and any children to see if the whole object
can be serialized for saving.

@param mixed $object The value to check.

@return bool
Checks the given object and any children to see if the whole object can be serialized for saving .