Questions tagged [repositories]

The tag has no usage guidance.

11 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
54 views

How to join multiple repositories

Suppose if I want to join product repository and orderItem repository, then how can do that? There is way to join multiple collections (methods like join, joinRight, joinLeft, ...), how to do same ...
2
votes
0answers
152 views

Joins on search criteria

Is thery any way to join other tables to SearchCriteriaInterface, while building it, before calling any getList method of any repository? I mean it should work more or less like joining tables on ...
1
vote
2answers
65 views

Avoid getting old data from customerRegistry in queue runner

We have a Magento 2 Queue Job which loads a customer /** @var \Magento\Customer\Model\ResourceModel\CustomerRepository */ $this->customerRepository->getById($this->customerId)); Now we ...
1
vote
1answer
265 views

Magento 2 Repositories and Database Transactions

Almost every post I read states that I should be working on objects using Magento 2 repositories rather that instantiating objects using Magento 2 object factories. That's what I started to do, and ...
1
vote
0answers
345 views

Is it possible to clear registry of OrderRepository?

I have a mass action which saves hundreds of orders via OrderRepository. And sometimes the process fails with PHP Fatal error: Allowed memory size of XXX bytes exhausted Because save() method of ...
1
vote
0answers
109 views

Magento 2: Install module from multiple repositories

Today I've stumbled into a fairly intriguing issue. At the moment I'm building a module for a client and possibly I'll use it for future clients. Now, I would like to keep the core code in a ...
0
votes
1answer
103 views

magento 2 resource model "save" to implement service contract persistence operations. not saving POST empty

I have a custom rest api for PUT and POST that the post data is an empty array therefore not saving as it's empty can anyone advise why or what could be wrong? /** * Save data. * * @...
0
votes
2answers
34 views

Sorting repository by more than one attribute

I want to sort a repository by more than one attribute. Any ideas of how to achieve this? What I have so far is this: public function getLatestPosts() { return $this->postRepository ->...
0
votes
1answer
316 views

Getting a table first row from repository

I'm building my first Magento 2 module, and I'm a bit stuck. First of all, this is what I have so far (I'm still fixing the coding standards on all the pages). https://github.com/moloni/magento2 I ...
0
votes
1answer
19 views

Repositories and Methods

Does anybody have a link where I can find a list of all Magento 2.1 (or Magento 2) repositories and their methods? I tried to find this in Magento Devdocs and can't seem to find anything. Maybe I am ...
0
votes
1answer
253 views

Custom Category Attribute not in Repository

I created a custom category multiselect attribute. (it's even a custom source but that does not matter). Everything is OK on save, admin forms OK, even the flat contains my values. ( thx to https://...