/** * Load collection with filters applied * * @param string $entityType * @param string $formCode * @return \Magento\Customer\Model\Resource\Form\Attribute\Collection */ public function loadAttributesCollection($entityType, $formCode) { $attributesFormCollection = $this->attrFormCollectionFactory->create(); $attributesFormCollection->setStore($this->storeManager->getStore())->setEntityType($entityType)->addFormCodeFilter($formCode)->setSortOrder(); return $attributesFormCollection; }