[TYPO3-mvc] ExtBase Ext without own tables, just using other tables (pages)

Henjo Hoeksma me at henjohoeksma.nl
Sun Oct 23 00:05:16 CEST 2011


Hi Stephen,

yes you mapped the classes. My err.

Regarding the Pid: yes the pid field from the DB is used but NO this is not
the same as a storagepid.

The query extbase builds uses a statement "AND tx_..._button.pid=" followed
by the storage pid set in your settings. You can try and see if you have
output using something like this in your findAll method:

[code]
$querySettings =
$this->objectManager->create('Tx_Extbase_Persistence_Typo3QuerySettings');
$querySettings->setRespectEnableFields(FALSE);
$querySettings->setRespectStoragePage(FALSE);
$query->setQuerySettings($querySettings);
[/code]

You gotta be aware though that the default enableFields for access etc are
not being used now!

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 Sat, Oct 22, 2011 at 13:05, Stephen Bungert <stephenbungert at yahoo.de>wrote:

> Thanks for the reply.
>
> What TS am I missing exactly?
>
> I have the book about developing extensions with extbase and fluid, but it
> just says when using other tables as datasources that you just need to add
> to the mapping array
>
> in persistence.classes
>
> In the book, there is an example about using tt_address.
>
> I just changed a few things so that it worked with pages.
>
> I have the pages model Tx_Nextprev_Domain_Model_Pages that has getters and
> setters for all the columns that I mapped.
>
> Isn't the storage pid just the pid field? Pages have them too I believe.
>
> "Henjo Hoeksma" <me at henjohoeksma.nl> schrieb im Newsbeitrag
> news:mailman.1.1319278274.**15326.typo3-project-**
> typo3v4mvc at lists.typo3.org...
>
>  Hi Stephen,
>>
>> building extensions with falling back to existing ones is perfectly
>> possible. Search the list for Single Table Inheritance.
>>
>> In your case you seem to be missing the TS Setup that tells extbase where
>> to find the repository.
>>
>> However, you will face a different problem: Pages are no records connected
>> to a storage pid. You will have to work around that too.
>>
>> Not sure if it will result in a workable solution, but it's always worth
>> trying.
>>
>> Good luck,
>>
>> Henjo
>>
>> On 2011-10-21 20:43:55 +0000, Stephen Bungert said:
>>
>>  Hello,
>>>
>>> I want to make an extension that outputs information from the pages
>>> table. It doesn't need it's own tables.
>>>
>>> I have a view that works, but doesn't have anything to display at the
>>> moment.
>>>
>>> I then setup the mapping for the pages table:
>>>
>>> plugin.tx_nextprev {
>>>  view {
>>>  templateRootPath = {$plugin.tx_nextprev.view.**templateRootPath}
>>>  partialRootPath = {$plugin.tx_nextprev.view.**partialRootPath}
>>>  layoutRootPath = {$plugin.tx_nextprev.view.**layoutRootPath}
>>>  }
>>>
>>>  persistence {
>>>  storagePid = {$plugin.tx_nextprev.**persistence.storagePid}
>>>
>>>  classes {
>>>   Tx_Nextprev_Domain_Model_Pages {
>>>    mapping {
>>>     tableName = pages
>>>     recordType = Tx_Nextprev_Domain_Model_Pages
>>>     columns {
>>>      uid.mapOnProperty = id
>>>      title.mapOnProperty = title
>>>      doktype.mapOnProperty = type
>>>      hidden.mapOnProperty = hidden
>>>      deleted.mapOnProperty = deleted
>>>      nav_hide.mapOnProperty = notInMenu
>>>     }
>>>    }
>>>   }
>>>  }
>>>  }
>>>
>>>  settings {
>>>  rootPage {
>>>   # Starting page (which page to collect page uids from)
>>>   uid = 3
>>>
>>>   # Should the root page be included in the next/prev chain?
>>>   include = 0
>>>  }
>>>
>>>  pages {
>>>   # Include shortcut pages
>>>   shortcut = 1
>>>
>>>   # Include notInMenu pages
>>>   notInMenu = 1
>>>
>>>   # Page UIDs to exclude
>>>   #excludedUids =
>>>  }
>>>  }
>>> }
>>>
>>>
>>> Here is my action function:
>>>
>>>
>>>
>>>  /**
>>>  * action buttons
>>>  *
>>>  * @return void
>>>  */
>>>  public function buttonsAction() {
>>>  $pages = $this->buttonsRepository->**findAll();
>>>  #t3lib_div::debug($pages, 1);
>>>  $this->view->assign('pages', $pages);
>>>  $this->view->assign('settings'**, $this->settings);
>>>  }
>>>
>>> If I leave it as it is the page is generated and fluid shows a message,
>>> like it should. No errors are displayed so i assume findAll() actually found
>>> what it needs to.
>>>
>>> If I uncomment the debug, the page timesout and is all white.
>>>
>>> My PHP error log shows a bytes exhausted error in
>>> C:\\xampp\\htdocs\\stephen\\**typo3\\4.6\\t3lib\\utility\\**class.t3lib_utility_debug.php
>>> on line 154
>>>
>>> I don't think that findAll is finding pages like I thought it would.
>>>
>>> Other extbase extensions that I have played around making worked, but
>>> they had their own tables.
>>>
>>> How can I see what findAll is doing? Can I make an extension that doesn't
>>> have it's own tables? I'm not sure if I have cretaed all the required files,
>>> a lot of the view templates and controllers and things I created myself
>>> based on other extbase extensions that I created as the extension builder
>>> only seems to create these things when you create tables.
>>>
>>> Stephen.
>>>
>>
>>
>>
> ______________________________**_________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc@**lists.typo3.org<TYPO3-project-typo3v4mvc at lists.typo3.org>
> http://lists.typo3.org/cgi-**bin/mailman/listinfo/typo3-**
> project-typo3v4mvc<http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc>
>


More information about the TYPO3-project-typo3v4mvc mailing list