Architectural patterns · Question 2 of 12
Which methods does an Extbase repository provide out of the box?
3 answers are correct. Easy
Show answer
Answer
- A findByUid()
- B findAll()
- D add()
Explanation
A repository is the central place for finding and storing domain objects, so the controller does not need to know any SQL. Every repository extending TYPO3\ comes with methods such as findAll(), findByUid(), findBy(), add(), update() and remove(). Example: $this->productRepository->findByUid(42) returns the product with UID 42 as an object. redirect(), on the other hand, belongs to the controller and assign() to the view; both are common mix-ups because they are used in the same action.