I want collection of one module in other module. I am doing it like
use Test\CompanyAddresses\Model\CompanyAddressFactory;
class ReformatTelephoneField implements DataPatchInterface
{
protected $companyAddressFactory;
/**
* @param CompanyAddressFactory $companyAddressFactory
*/
public function __construct(
CompanyAddressFactory $companyAddressFactory
) {
$this->companyAddressFactory = $companyAddressFactory;
}
public function apply()
{
$companyAddressCollection = $this->companyAddressFactory->create()->getCollection();
}
}
I have provided basic code logic that how I am getting collection but on setup:upgrade I am getting issue like Model collection resource name is not defined. Don't know what is the issue.