I have installed a module that allowing to upload attachment to products. But I have to do this pro-grammatically via my other custom module. installed module have API function in it. But I don’t know how to call these API function in Magento-2.
As API file Api/ProductAttachmentRepositoryInterface.php
have function –
public function save(Data\ProductAttachmentInterface $ productAttachment);
And respective file at location Data/ProductAttachmentInterface.php have following code . That have some variable declaration, get/set function.
`namespace Companyname\ProductAttachment\Api\Data; interface ProductAttachmentInterface { const ID = 'id'; const PRODUCT_ID = 'product_id'; const FILE_PATH = 'file_path'; const FILE_NAME = 'file_name'; const FILE_URL = 'file_url'; const FILE_SIZE = 'file_size'; const FILE_TYPE = 'file_type'; const FILE_TYPE_FILE = 'file'; const FILE_TYPE_URL = 'url'; const CUSTOMER_GROUP = 'customer_group'; const STORE_CONFIG = 'store_config'; const CONTENT = 'content'; public function getId(); public function getProductId(); //public function getFilePath(); public function getFileName();public function setId($ id); `
Here I am bit confuse…..what I need to pass as parameter and which function I should call and how ?
Please help me on this…