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\CMS\Extbase\Persistence\Repository 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.

Certifications & exams

Which exam comes next?

You can already practise for 19 exams, and 21 are up for a vote. See all certifications with their official information, cast your vote or suggest your exam.

See all certifications