Override constructor in your Model class and add your model class as dependency.
protected $_modelObj;
public function __construct(
...
\Vendor\Example\Model\Model $modelObj,
...
) {
...
$this->modelObj = $modelObj;
...
}
function someMetod() {
$model = $this->modelObj->create();
}
There are thousands of examples you can find in google for same. Also you can check core files how it is implemented.
Adding here one specific answer for your question:
protected $_quoteFactory;
public function __construct(
...
\Magento\Quote\Model\QuoteFactory $quoteFactory
) {
$this->_quoteFactory = $quoteFactory;
parent::__construct(...);
}
Then in your class you can do:
$this->_quoteFactory->create()->loadByIdWithoutStore($quoteId);
For using it in your custom class, check this link!
Hope this helps!
<?php
namespace Yourcompany\<yourmodule>\Helper {
/**
* Customer data helper
*/
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
protected $customerRepository;
public function __construct(
\Magento\Customer\Api\CustomerRepositoryInterfaceFactory $customerRepositoryFactory) {
$this->customerRepository = $customerRepositoryFactory->create();
}
public LoadCustomerById($customerId) {
$customer = $this->customerRepository->getById($customerId);
return $customer;
}
}
Same way you can add functions for getting product detail and use these in your module controller. Hope this helps!