src/Thybag/SharePointAPI.php
public function getAttachments ($list_name, $list_item_id) {
		// Wrap in CAML
		$CAML = '
		<GetAttachmentCollection xmlns="http://schemas.microsoft.com/sharepoint/soap/">
			<listName>' . $list_name . '</listName>
			<listItemID>' . $list_item_id . '</listItemID>
		</GetAttachmentCollection>';

		$xmlvar = new \SoapVar($CAML, XSD_ANYXML);

		// Attempt to run operation
		try {
			$rawXml = $this->soapClient->GetAttachmentCollection($xmlvar)->GetAttachmentCollectionResult->any;
		} catch (\SoapFault $fault) {
			$this->onError($fault);
		}

		// Load XML in to DOM document and grab all list items.
		$nodes = $this->getArrayFromElementsByTagName($rawXml, 'Attachment');

		$attachments = array();

		// Format data in to array or object
		foreach ($nodes as $counter => $node) {
			$attachments[] = $node->textContent;
		}

		// Return Array of attachment URLs
		return $attachments;
	}
public function getAttachments ($list_name, $list_item_id) {
		// Wrap in CAML
		$CAML = '
		<GetAttachmentCollection xmlns="http://schemas.microsoft.com/sharepoint/soap/">
			<listName>' . $list_name . '</listName>
			<listItemID>' . $list_item_id . '</listItemID>
		</GetAttachmentCollection>';

		$xmlvar = new \SoapVar($CAML, XSD_ANYXML);

		// Attempt to run operation
		try {
			$rawXml = $this->soapClient->GetAttachmentCollection($xmlvar)->GetAttachmentCollectionResult->any;
		} catch (\SoapFault $fault) {
			$this->onError($fault);
		}

		// Load XML in to DOM document and grab all list items.
		$nodes = $this->getArrayFromElementsByTagName($rawXml, 'Attachment');

		$attachments = array();

		// Format data in to array or object
		foreach ($nodes as $counter => $node) {
			$attachments[] = $node->textContent;
		}

		// Return Array of attachment URLs
		return $attachments;
	}
public function getAttachments ( $ list_name , $ list_item_id ) { // Wrap in CAML $ CAML = '
		<GetAttachmentCollection xmlns="http://schemas.microsoft.com/sharepoint/soap/">
			<listName>' . $ list_name . '</listName>
			<listItemID>' . $ list_item_id . '</listItemID>
		</GetAttachmentCollection>' ; $ xmlvar = new \ SoapVar ( $ CAML , XSD_ANYXML ) ; // Attempt to run operation try { $ rawXml = $ this -> soapClient -> GetAttachmentCollection ( $ xmlvar ) -> GetAttachmentCollectionResult -> any ; } catch ( \ SoapFault $ fault ) { $ this -> onError ( $ fault ) ; } // Load XML in to DOM document and grab all list items. $ nodes = $ this -> getArrayFromElementsByTagName ( $ rawXml , 'Attachment' ) ; $ attachments = array ( ) ; // Format data in to array or object foreach ( $ nodes as $ counter => $ node ) { $ attachments [ ] = $ node -> textContent ; } // Return Array of attachment URLs return $ attachments ; }
getAttachment
Return an attachment from a SharePoint list item

@param $list_name Name of list
@param $list_item_id ID of record item is attached to
@return Array of attachment urls
getAttachment Return an attachment from a SharePoint list item