[TYPO3-english] Extention Builder and relations to tebles

Jigal van Hemert jigal.van.hemert at typo3.org
Sun Jun 22 10:20:46 CEST 2014


Hi,

On 22-6-2014 9:33, Christian Tauscher wrote:
> With Extention_builder I'd like to connext a tt_address Record with my
> Record.
>
>
> I create a Relation, 1:1, and...
>
> .. what ist \Fully\Qualified\Classname
>
> With EXTbase this would be
>
> \{VendorName}\{PackageName}\({CategoryName}\)*{ClassName}
>
> http://docs.typo3.org/TYPO3/CoreApiReference/ApiOverview/Namespaces/Index.html
>
> But what is the Vendor of tt_address, fe_users etc...
>
> Is it possible to connect this "old"-Style Extentions to Extbase?

To connect to an "old"-Style table there must be a model of the objects 
in that table. For some of the tables from the core there are models 
available in /sysext/extbase/Classes/Domain/Model. For example there is 
a file FrontendUser.php for the model for fe_users.

For third party data such as tt_address, you can make your own model. In 
the git version of tt_address I just found that there is already a model 
TYPO3\TtAddress\Domain\Model\Address .

In the extension builder you can set which table to use with "Map to 
existing table". If this doesn't work completely you can adjust or set 
the mapping yourself in the TypoScript configuration.

persistence {
   classes {
     Vendor\Package\Domain\Model\Address {
       newRecordStoragePid = nn
       mapping {
         tableName = tt_address
         columns {
           first_name.mapOnProperty = firstName

and so on...

There is a great book by Patrick Lobacher that can help you a lot with 
building extensions with Extbase:
http://www.opensourcepress.de/de/produkte/TYPO3-Extbase/18824/978-3-95539-070-9

-- 
Jigal van Hemert
TYPO3 CMS Active Contributor

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the TYPO3-english mailing list