[TYPO3-mvc] Extbase mapping to foreign table doesn't work

Henjo Hoeksma me at henjohoeksma.nl
Thu Mar 1 22:33:24 CET 2012


I guess it happens to all of us every know and then ;-)

The programmers tunnel!
Great you found it.

Kind regards,

Henjo

Problems are small because we learned how to deal with them.
Problems are big because we need to learn how to deal with them.


On Thu, Mar 1, 2012 at 19:29, David Greiner <davidgreiner at gmx.net> wrote:

> Hey Henjo!
>
> Thanks for your answer! I got it. I forgot to set storagepid... very
> embarrassing.
>
> ...greets
>
> -----Ursprüngliche Nachricht-----
> Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org
> [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von
> Henjo Hoeksma
> Gesendet: Donnerstag, 1. März 2012 13:34
> An: TYPO3 v4 MVC project
> Betreff: Re: [TYPO3-mvc] Extbase mapping to foreign table doesn't work
>
> Hi David,
>
> some thoughts:
>
> verified PID?
> Verified the mail messages are actually of the recordType?
> Added the recordType to the powermail TCA?
> Cleared caching tables?
>
> Kind regards,
>
> Henjo
>
> Problems are small because we learned how to deal with them.
> Problems are big because we need to learn how to deal with them.
>
>
> On Wed, Feb 29, 2012 at 19:24, David Greiner <davidgreiner at gmx.net> wrote:
>
> > Hi boys and girls!
> >
> > I'm trying to list some entries from a foreign table (tx_powermail_mails)
> > in
> > an extbase-extension. But something is going wrong.
> > I have created a blank extension with the new extension_builder (v2.2.0)
> > and
> > "map to existing table" --> tx_powermail_mails. Further I have created a
> > property called "recipients" (like the column in table
> tx_powermail_mails)
> > and added the following typoscript.
> >
> >
> > -----------TS-------------
> >
> > plugin.tx_test {
> >        view {
> >                templateRootPath = {$plugin.tx_test.view.templateRootPath}
> >                partialRootPath = {$plugin.tx_test.view.partialRootPath}
> >                layoutRootPath = {$plugin.tx_test.view.layoutRootPath}
> >        }
> >        persistence {
> >                storagePid = {$plugin.tx_test.persistence.storagePid}
> >                classes {
> >                    Tx_Test_Domain_Model_List {
> >                        mapping {
> >                            tableName = tx_powermail_mails
> >                            recordType = Tx_Test_Domain_Model_List
> >                            columns {
> >                                recipient.mapOnProperty = recipient
> >                            }
> >                        }
> >                    }
> >                }
> >        }
> > }
> >
> >
>
> config.tx_extbase.persistence.classes.Tx_Test_Domain_Model_List.mapping.tabl
> > eName = tx_powermail_mails
> >
> > -----------TS-------------
> >
> >
> >
> > The model looks like this:
> > -----------Model-------------
> >
> > class Tx_Test_Domain_Model_List extends
> > Tx_Extbase_DomainObject_AbstractEntity {
> >
> >        /**
> >         * recipient
> >         *
> >         * @var string
> >         */
> >        protected $recipient;
> >
> >        /**
> >         * Returns the recipient
> >         *
> >         * @return string $recipient
> >         */
> >        public function getRecipient() {
> >                return $this->recipient;
> >        }
> >
> >        /**
> >         * Sets the recipient
> >         *
> >         * @param string $recipient
> >         * @return void
> >         */
> >        public function setRecipient($recipient) {
> >                $this->recipient = $recipient;
> >        }
> >
> > }
> >
> > -----------Model-------------
> >
> >
> > The repository like this:
> > -----------Repo-------------
> >
> > class Tx_Test_Domain_Repository_ListRepository extends
> > Tx_Extbase_Persistence_Repository { }
> >
> > -----------Repo-------------
> >
> >
> > and the controller like this:
> > -----------Controller-------------
> >
> > class Tx_Test_Controller_ListController extends
> > Tx_Extbase_MVC_Controller_ActionController {
> >
> >        /**
> >         * listRepository
> >         *
> >         * @var Tx_Test_Domain_Repository_ListRepository
> >         */
> >        protected $listRepository;
> >
> >        /**
> >         * injectListRepository
> >         *
> >         * @param Tx_Test_Domain_Repository_ListRepository $listRepository
> >         * @return void
> >         */
> >        public function
> > injectListRepository(Tx_Test_Domain_Repository_ListRepository
> > $listRepository) {
> >                $this->listRepository = $listRepository;
> >        }
> >
> >        /**
> >         * action list
> >         *
> >         * @return void
> >         */
> >        public function listAction() {
> >                $lists = $this->listRepository->findAll();
> >                $this->view->assign('lists', $lists);
> >        }
> >
> > }
> >
> > -----------Controller-------------
> >
> >
> > I've thought that now it should be possible to connect to the foreign
> table
> > and list their entries in my fluid-template.
> > But $lists is still empty. Whats going wrong?
> >
> > It would be great if somebody take some minutes to help me :)
> >
> > Google shows almost only tutorials for how to mapping to fe_user-table
> with
> > the possibilities which are already included in extbase.
> >
> >
> > PS: Sorry for my bad english ;)
> >
> > Greets, David.
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > TYPO3-project-typo3v4mvc mailing list
> > TYPO3-project-typo3v4mvc at lists.typo3.org
> > http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
> >
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>


More information about the TYPO3-project-typo3v4mvc mailing list