PHPackages                             stefanfroemken/sf-join - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. stefanfroemken/sf-join

ActiveTypo3-cms-extension[Database &amp; ORM](/categories/database)

stefanfroemken/sf-join
======================

SF DB JOIN

11PHP

Since Jun 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/froemken/sf_join)[ Packagist](https://packagist.org/packages/stefanfroemken/sf-join)[ RSS](/packages/stefanfroemken-sf-join/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

sf\_join
========

[](#sf_join)

This is just a TYPO3 demo extension to show you possibilities on how to get records from database by TYPO3 API.

Please have a look into ProductRepository class. There are currently 4 main methods collecting records:

- by Extbase Query
- by TYPO3 QueryBuilder injected into Extbase Query
- by just TYPO3 QueryBuilder
- by getRecords() of ContentObjectRenderer

Extbase Query
-------------

[](#extbase-query)

Use it as often and whereever possible.

PROS:

- It is short (less code)
- Workspace overlay integrated
- Language overlay integrated
- Translated records are respecting ORDER BY
- COUNT on JOINed tables is working. Extbase changes SELECT to `COUNT(DISTINCT table.uid)`

CONS:

- It's always `SELECT *`
- You can not change the SELECT part. Working with AVG(), SUBSTRING(), ... is not possible
- GROUP BY is not implemented
- There is no possibility to sort sub records

TYPO3 QueryBuilder with Extbase Query
-------------------------------------

[](#typo3-querybuilder-with-extbase-query)

It's OK for single table usage. Don't use it with JOINs because of the COUNT problem.

PROS:

- You can modify all query parts to your need
- Extendability: Send QueryBuilder to a Hook, Event or other method and you can change everything

CONS:

- COUNT on JOINed tables is not working. SELECT is still `COUNT()` instead of `COUNT(DISTINCT table.uid)`
- A JOIN produces a cartesian product
- On JOINed tables you have to add GROUP BY on your own
- If you're working with ONLY\_FULL\_GROUP\_BY you have to add ALL columns of SELECT to GROUP BY.
- It's up to you to JOIN tables correctly. Do not forget to add tablenames, fieldname and all the other matching columns (from TCA)
- You have to add the storage PIDs on your own
- It's your job to modify your query for correct language handling

Plain TYPO3 QueryBuilder
------------------------

[](#plain-typo3-querybuilder)

This is for TYPO3 Pros only. You really have to know what you're doing.

PROS:

- Do whatever you want
- COUNT() is always right, as it was NOT set by an automatism

CONS:

- The resultset is not compatible with QueryResultInterface. So, you're working with the already fetched records
- You have to call versionOL()
- You have to call getLanguageOverlay()
- If you want sorted and translated records you have to add a really huge extra query on your own
- You have to map your resultset to domain models on your own
- You have to work with your own Pagination/Paginator or you have to work with full resultset as array
- You have to add the storage PIDs on your own
- A method to collect JOINed query can be a lot of work and very very long

getRecords of cObj
------------------

[](#getrecords-of-cobj)

Very easy. The Typo3DatabaseProcessor of fluid package also uses this method. Translation and Workspacing will be done for you.

PROS:

- Easy
- Syntax is known since ages
- You can modify SELECT part
- You can work with JOINs
- GROUP BY is also possible

CONS:

- Remember special syntax for column identifier: `{#column}`
- Multiple JOINs can be very messy
- As table alias is not possible, you always have to use full tablename: `tx_sfjoin_domain_model_product.title` instead of `p.title`
- Fixed collection of allowed SELECT functions: COUNT|MAX|MIN|AVG|SUM|DISTINCT
- ORDER BY on translated records is not possible. Records are sorted in default language. Records were translated 1:1 not respecting ORDER BY.

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/05dced6126901d1575247395215456bd04a4db8186a80a53e02bb142b9888331?d=identicon)[froemken](/maintainers/froemken)

---

Top Contributors

[![froemken](https://avatars.githubusercontent.com/u/2532472?v=4)](https://github.com/froemken "froemken (8 commits)")

### Embed Badge

![Health badge](/badges/stefanfroemken-sf-join/health.svg)

```
[![Health](https://phpackages.com/badges/stefanfroemken-sf-join/health.svg)](https://phpackages.com/packages/stefanfroemken-sf-join)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M542](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M209](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
