[TYPO3-dev] Ignore tx_extbase_type

Stephan Schuler Stephan.Schuler at netlogix.de
Fri Feb 27 11:12:57 CET 2015


Hey there.

Have a look at the TYPO3\CMS\Extbase\Persistence\Repository class.
In general, there is the Repository::$objectType property determining the class name a certain repository is responsible for.

You will find a method Repository::getRepositoryClassName() which basically returns the result of "get_class($this)". Educated guess: Just use "get_parent_class($this)" instead.

Look at Repository::__construct() setting $this->objectType. There the result of the Repository::getRepositoryClassName() method is just preg_replaced to determine the model class the current repository is responsible for.

Certain parts of the Repository just refer to that $this->objectType. First of all is createQuery(). Then there is findByIdentifier(), and even add(), update and remove() either require a certain object to be "instance of $this->objectType" or take the objectType as argument for something.

So, the only thing you need to do is manipulating the objectType to not point to your model but the parent class of your model. The best way clearly is the "getRepositoryClassName()" method.

Regards,



Stephan Schuler
Web-Entwickler | netlogix Media

Telefon: +49 (911) 539909 - 0
E-Mail: Stephan.Schuler at netlogix.de
Web: media.netlogix.de




netlogix GmbH & Co. KG
IT-Services | IT-Training | Media
Neuwieder Straße 10 | 90411 Nürnberg
Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
E-Mail: info at netlogix.de | Web: http://www.netlogix.de

netlogix GmbH & Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
Umsatzsteuer-Identifikationsnummer: DE 233472254
Geschäftsführer: Stefan Buchta, Matthias Schmidt



-----Ursprüngliche Nachricht-----
Von: typo3-dev-bounces at lists.typo3.org [mailto:typo3-dev-bounces at lists.typo3.org] Im Auftrag von Daniel Ritter
Gesendet: Donnerstag, 26. Februar 2015 22:08
An: typo3-dev at lists.typo3.org
Betreff: Re: [TYPO3-dev] Ignore tx_extbase_type

Thank you Richard, but using of the standard FrontendUserRepository is no option because my model is extending this. My Problem is I need all active FE-users, because on the target system there is mainly an other extension in using for the creation of them.  So my target is to ignore the tx_extbase_type-condition.

Has someone a solution for this requirement?
_______________________________________________
TYPO3-dev mailing list
TYPO3-dev at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev


More information about the TYPO3-dev mailing list