ResourceUtil.php
public static function convertObjectsToResourceList(array $objects, $requireClass, $allowForm = true)
    {
        $list = new ResourceList();

        foreach ($objects as $i => $object) {
            static::validateObjectResource($object, $requireClass, $i, $allowForm);
            $list->add(new ResourceItem((object) $object));
        }

        return $list;
    }
public static function convertObjectsToResourceList(array $objects, $requireClass, $allowForm = true)
    {
        $list = new ResourceList();

        foreach ($objects as $i => $object) {
            static::validateObjectResource($object, $requireClass, $i, $allowForm);
            $list->add(new ResourceItem((object) $object));
        }

        return $list;
    }
public static function convertObjectsToResourceList ( array $ objects , $ requireClass , $ allowForm = true ) { $ list = new ResourceList ( ) ; foreach ( $ objects as $ i => $ object ) { static :: validateObjectResource ( $ object , $ requireClass , $ i , $ allowForm ) ; $ list -> add ( new ResourceItem ( ( object ) $ object ) ) ; } return $ list ; }
Convert the object data of resource to resource list.

@param FormInterface[]|object[] $objects      The resource object instance or form of object instance
@param string                   $requireClass The require class name
@param bool                     $allowForm    Check if the form is allowed

@throws InvalidResourceException When the instance object in the list is not an instance of the required class

@return ResourceList
Convert the object data of resource to resource list .