apps/sharebymail/lib/ShareByMailProvider.php
/**
	 * Create a share object from an database row
	 *
	 * @param array $data
	 * @return IShare
	 * @throws InvalidShare
	 * @throws ShareNotFound
	 */
Create a share object from an database row
@param array $data
@return IShare
@throws InvalidShare
@throws ShareNotFound
Create a share object from an database row @param array $data @return IShare @throws InvalidShare @throws ShareNotFound
protected function createShareObject($data) {
		$share = new Share($this->rootFolder, $this->userManager);
		$share->setId((int)$data['id'])
			->setShareType((int)$data['share_type'])
			->setPermissions((int)$data['permissions'])
			->setTarget($data['file_target'])
			->setMailSend((bool)$data['mail_send'])
			->setToken($data['token']);
		$shareTime = new \DateTime();
		$shareTime->setTimestamp((int)$data['stime']);
		$share->setShareTime($shareTime);
		$share->setSharedWith($data['share_with']);
		$share->setPassword($data['password']);
		if ($data['uid_initiator'] !== null) {
			$share->setShareOwner($data['uid_owner']);
			$share->setSharedBy($data['uid_initiator']);
		} else {
			$share->setSharedBy($data['uid_owner']);
			$path = $this->getNode($share->getSharedBy(), (int)$data['file_source']);
			$owner = $path->getOwner();
			$share->setShareOwner($owner->getUID());
		}
		if ($data['expiration'] !== null) {
			$expiration = \DateTime::createFromFormat('Y-m-d H:i:s', $data['expiration']);
			if ($expiration !== false) {
				$share->setExpirationDate($expiration);
			}
		}
		$share->setNodeId((int)$data['file_source']);
		$share->setNodeType($data['item_type']);
		$share->setProviderId($this->identifier());
		return $share;
	}
protected function createShareObject ( $ data ) { $ share = new Share ( $ this -> rootFolder , $ this -> userManager ) ; $ share -> setId ( ( int ) $ data [ 'id' ] ) -> setShareType ( ( int ) $ data [ 'share_type' ] ) -> setPermissions ( ( int ) $ data [ 'permissions' ] ) -> setTarget ( $ data [ 'file_target' ] ) -> setMailSend ( ( bool ) $ data [ 'mail_send' ] ) -> setToken ( $ data [ 'token' ] ) ; $ shareTime = new \ DateTime ( ) ; $ shareTime -> setTimestamp ( ( int ) $ data [ 'stime' ] ) ; $ share -> setShareTime ( $ shareTime ) ; $ share -> setSharedWith ( $ data [ 'share_with' ] ) ; $ share -> setPassword ( $ data [ 'password' ] ) ; if ( $ data [ 'uid_initiator' ] !== null ) { $ share -> setShareOwner ( $ data [ 'uid_owner' ] ) ; $ share -> setSharedBy ( $ data [ 'uid_initiator' ] ) ; } else { $ share -> setSharedBy ( $ data [ 'uid_owner' ] ) ; $ path = $ this -> getNode ( $ share -> getSharedBy ( ) , ( int ) $ data [ 'file_source' ] ) ; $ owner = $ path -> getOwner ( ) ; $ share -> setShareOwner ( $ owner -> getUID ( ) ) ; } if ( $ data [ 'expiration' ] !== null ) { $ expiration = \ DateTime :: createFromFormat ( 'Y-m-d H:i:s' , $ data [ 'expiration' ] ) ; if ( $ expiration !== false ) { $ share -> setExpirationDate ( $ expiration ) ; } } $ share -> setNodeId ( ( int ) $ data [ 'file_source' ] ) ; $ share -> setNodeType ( $ data [ 'item_type' ] ) ; $ share -> setProviderId ( $ this -> identifier ( ) ) ; return $ share ; }
Create a share object from an database row
 @param array $data
 @return IShare
 @throws InvalidShare
 @throws ShareNotFound
Create a share object from an database row @param array $data @return IShare @throws InvalidShare @throws ShareNotFound
//OLD SHARE