User Tools

Site Tools


extbase

TYPO3 SQL

$queryParser = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::class);
DebuggerUtility::var_dump($queryParser->convertQueryToDoctrineQueryBuilder($query)->getSQL());

Search for categories

    /**
     * Findby Categories
     *
     * @param type $categories
     * @return type
     */
    public function findByCategories($categories) {
        $query = $this->createQuery();
        foreach ($categories as $category) {
            $constraint[] = $query->contains('category', $category);
        }
        $result = $query->matching($query->logicalOr($query->logicalOr($constraint)))->execute();
        if (count($result) > 0) {
            return $result;
        }
    }
extbase.txt · Last modified: 2017/10/17 06:05 by admin