Feature #2603

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

Added by Robert Lemke almost 11 years ago. Updated about 9 years ago.

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

0%

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 set Resolved 2008-10-11
Duplicates TYPO3.Flow - Feature #1676: FLOW3, Persistence: support for "magic finder methods" Resolved 2008-10-11

Associated revisions

Revision d76c6aaf (diff)
Added by Robert Lemke almost 11 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 almost 11 years ago

  • Status changed from Accepted to Resolved

Applied in changeset r1890.

Also available in: Atom PDF