src/Proxy/DriveItemProxy.php
public function getChildren()
    {
        $driveLocator = "/drives/{$this->parentReference->driveId}";
        $itemLocator  = "/items/{$this->id}";
        $endpoint     = "$driveLocator$itemLocator/children";

        $response = $this
            ->graph
            ->createCollectionRequest('GET', $endpoint)
            ->execute();

        $status = $response->getStatus();

        if ($status != 200) {
            throw new \Exception("Unexpected status code produced by 'GET $endpoint': $status");
        }

        $driveItems = $response->getResponseAsObject(DriveItem::class);

        if (!is_array($driveItems)) {
            return [];
        }

        return array_map(function (DriveItem $driveItem) {
            return new self($this->graph, $driveItem);
        }, $driveItems);
    }
public function getChildren()
    {
        $driveLocator = "/drives/{$this->parentReference->driveId}";
        $itemLocator  = "/items/{$this->id}";
        $endpoint     = "$driveLocator$itemLocator/children";

        $response = $this
            ->graph
            ->createCollectionRequest('GET', $endpoint)
            ->execute();

        $status = $response->getStatus();

        if ($status != 200) {
            throw new \Exception("Unexpected status code produced by 'GET $endpoint': $status");
        }

        $driveItems = $response->getResponseAsObject(DriveItem::class);

        if (!is_array($driveItems)) {
            return [];
        }

        return array_map(function (DriveItem $driveItem) {
            return new self($this->graph, $driveItem);
        }, $driveItems);
    }
public function getChildren ( ) { $ driveLocator = "/drives/{$this->parentReference->driveId}" ; $ itemLocator = "/items/{$this->id}" ; $ endpoint = "$driveLocator$itemLocator/children" ; $ response = $ this -> graph -> createCollectionRequest ( 'GET' , $ endpoint ) -> execute ( ) ; $ status = $ response -> getStatus ( ) ; if ( $ status != 200 ) { throw new \ Exception ( "Unexpected status code produced by 'GET $endpoint': $status" ) ; } $ driveItems = $ response -> getResponseAsObject ( DriveItem :: class ) ; if ( ! is_array ( $ driveItems ) ) { return [ ] ; } return array_map ( function ( DriveItem $ driveItem ) { return new self ( $ this -> graph , $ driveItem ) ; } , $ driveItems ) ; }
Gets this folder drive item's children.

@return array
The child drive items.

@todo Support pagination using a native iterator.
Gets this folder drive item s children .