[TYPO3-mvc] custom query including the hidden Elements

Jochen Rau jochen.rau at typoplanet.de
Tue May 18 17:21:12 CEST 2010


Hi Jonas.

On 18.05.10 16:48, Jonas Götze wrote:
> I am writing a custom query where I am trying to find _all_ (undeleted)
> elements of a table, whether they are hidden or not.
> If I search by UID (which has hidden = 1) for example
> $query->matching(
> $query->equals('uid',3)
> );
> I get no result.
> So I tried something like the following
> $query->matching(
> $query->logicalAnd(
> $query->like('hidden', '%'),
> $query->equals('uid',3)
> )
> );
> which wont work too.
> I also tried various variants like
> hidden equals 1
> or something similiar but I can't seem to get the hidden elements.
> Is it impossible using the custom query?

Try to set the enable fields setting to FALSE:

$query->getQuerySettings()->setRespectEnableFields(FALSE);
$query->matching(
	$query->logicalAnd(
		$query->equals('uid', 3),
		$query->equals('deleted', 0)
	)
);
$result = $query->execute();

Regards
Jochen


More information about the TYPO3-project-typo3v4mvc mailing list