Google_ParentsServiceResource

The "parents" collection of methods.

Defined (1)

The class is defined in the following location(s).

/inc/google-api-php-client/src/contrib/Google_DriveService.php  
  1. class Google_ParentsServiceResource extends Google_ServiceResource { 
  2.  
  3.  
  4. /** 
  5. * Adds a parent folder for a file. (parents.insert) 
  6. * @param string $fileId The ID of the file. 
  7. * @param Google_ParentReference $postBody 
  8. * @param array $optParams Optional parameters. 
  9. * @return Google_ParentReference 
  10. */ 
  11. public function insert($fileId, Google_ParentReference $postBody, $optParams = array()) { 
  12. $params = array('fileId' => $fileId, 'postBody' => $postBody); 
  13. $params = array_merge($params, $optParams); 
  14. $data = $this->__call('insert', array($params)); 
  15. if ($this->useObjects()) { 
  16. return new Google_ParentReference($data); 
  17. } else { 
  18. return $data; 
  19. /** 
  20. * Gets a specific parent reference. (parents.get) 
  21. * @param string $fileId The ID of the file. 
  22. * @param string $parentId The ID of the parent. 
  23. * @param array $optParams Optional parameters. 
  24. * @return Google_ParentReference 
  25. */ 
  26. public function get($fileId, $parentId, $optParams = array()) { 
  27. $params = array('fileId' => $fileId, 'parentId' => $parentId); 
  28. $params = array_merge($params, $optParams); 
  29. $data = $this->__call('get', array($params)); 
  30. if ($this->useObjects()) { 
  31. return new Google_ParentReference($data); 
  32. } else { 
  33. return $data; 
  34. /** 
  35. * Lists a file's parents. (parents.list) 
  36. * @param string $fileId The ID of the file. 
  37. * @param array $optParams Optional parameters. 
  38. * @return Google_ParentList 
  39. */ 
  40. public function listParents($fileId, $optParams = array()) { 
  41. $params = array('fileId' => $fileId); 
  42. $params = array_merge($params, $optParams); 
  43. $data = $this->__call('list', array($params)); 
  44. if ($this->useObjects()) { 
  45. return new Google_ParentList($data); 
  46. } else { 
  47. return $data; 
  48. /** 
  49. * Removes a parent from a file. (parents.delete) 
  50. * @param string $fileId The ID of the file. 
  51. * @param string $parentId The ID of the parent. 
  52. * @param array $optParams Optional parameters. 
  53. */ 
  54. public function delete($fileId, $parentId, $optParams = array()) { 
  55. $params = array('fileId' => $fileId, 'parentId' => $parentId); 
  56. $params = array_merge($params, $optParams); 
  57. $data = $this->__call('delete', array($params)); 
  58. return $data;