Feature #2603

Implement magic findBy*() and findOneBy*() methods in the base repository

Added by Robert Lemke over 6 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2009-02-10
Priority:Must have Due date:
Assigned To:Robert Lemke % Done:

0%

Category:Persistence
Target version:TYPO3 Flow Base Distribution - 1.0 alpha 1
PHP Version: Complexity:
Has patch:

Description

The base Repository should provide some magic __call() method taking care of findBy*() and findOneBy*() method calls, returning the results of searches for a property called after the method:

   $result1 = $repository->findByFoo('bar');
   $result2 = $repository->findOneByFoo('bar');

$result1 will contain an array of all objects whose property 'foo' is 'bar'.
$result2 will contain the first object which matches a search for 'foo' == 'bar'.


Related issues

related to TYPO3.Flow - Feature #1677: Query: add convenience method returning the first object ... Resolved 2008-10-11
duplicates TYPO3.Flow - Feature #1676: FLOW3, Persistence: support for "magic finder methods" Resolved 2008-10-11

Associated revisions

Revision d76c6aaf
Added by Robert Lemke over 6 years ago

  • FLOW3: (Persistence) Implemented magic findBy*() and findOneBy*() methods for the base repository. Resolves #1676 and closes #2603.

History

#1 Updated by Robert Lemke over 6 years ago

  • Status changed from Accepted to Resolved

Applied in changeset r1890.

Also available in: Atom PDF