src/Client.php
public function fetchDriveItem($driveItemId = null)
    {
        $message = sprintf(
            '%s() is deprecated and will be removed in version 3;'
                . ' use Krizalys\Onedrive\Client::getDriveItemById() instead.',
            __METHOD__
        );

        @trigger_error($message, E_USER_DEPRECATED);
        $drive = $this->getMyDrive();

        $item = $driveItemId !== null ?
            $this->getDriveItemById($drive->id, $driveItemId)
            : $drive->getRoot();

        $options = $this->buildOptions($item, ['parent_id' => $driveItemId]);

        return $this->isFolder($item) ?
            new Folder($this, $item->id, $options)
            : new File($this, $item->id, $options);
    }
public function fetchDriveItem($driveItemId = null)
    {
        $message = sprintf(
            '%s() is deprecated and will be removed in version 3;'
                . ' use Krizalys\Onedrive\Client::getDriveItemById() instead.',
            __METHOD__
        );

        @trigger_error($message, E_USER_DEPRECATED);
        $drive = $this->getMyDrive();

        $item = $driveItemId !== null ?
            $this->getDriveItemById($drive->id, $driveItemId)
            : $drive->getRoot();

        $options = $this->buildOptions($item, ['parent_id' => $driveItemId]);

        return $this->isFolder($item) ?
            new Folder($this, $item->id, $options)
            : new File($this, $item->id, $options);
    }
public function fetchDriveItem ( $ driveItemId = null ) { $ message = sprintf ( '%s() is deprecated and will be removed in version 3;' . ' use Krizalys\Onedrive\Client::getDriveItemById() instead.' , __METHOD__ ) ; @ trigger_error ( $ message , E_USER_DEPRECATED ) ; $ drive = $ this -> getMyDrive ( ) ; $ item = $ driveItemId !== null ? $ this -> getDriveItemById ( $ drive -> id , $ driveItemId ) : $ drive -> getRoot ( ) ; $ options = $ this -> buildOptions ( $ item , [ 'parent_id' => $ driveItemId ] ) ; return $ this -> isFolder ( $ item ) ? new Folder ( $ this , $ item -> id , $ options ) : new File ( $ this , $ item -> id , $ options ) ; }
Fetches a drive item from the current OneDrive account.

@param null|string $driveItemId
The unique ID of the OneDrive drive item to fetch, or null to
fetch the OneDrive root folder. Default: null.

@return object
The drive item fetched, as a DriveItem instance referencing to
the OneDrive drive item fetched.

@deprecated Use Krizalys\Onedrive\Client::getDriveItemById() instead.
Fetches a drive item from the current OneDrive account .