Feature #2603

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

Added by Robert Lemke about 12 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Must have
Assignee:
Category:
Persistence
Start date:
2009-02-10
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
Complexity:

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 of a result setResolvedKarsten Dambekalns2008-10-11

Actions
Is duplicate of TYPO3.Flow - Feature #1676: FLOW3, Persistence: support for "magic finder methods"Resolved2008-10-11

Actions
#1

Updated by Robert Lemke about 12 years ago

  • Status changed from Accepted to Resolved

Applied in changeset r1890.

Also available in: Atom PDF