[TYPO3-dev] Extbase mapping "pages" table
frank at f03.eu
frank at f03.eu
Fri Apr 26 15:26:49 CEST 2013
Hi,
seems your slashes are wrong ion your TS mapping, you need Backslashes for
namespace'd access...
-----Ursprüngliche Nachricht-----
Von: typo3-dev-bounces at lists.typo3.org
[mailto:typo3-dev-bounces at lists.typo3.org] Im Auftrag von Luigi Tenti
Gesendet: Freitag, 26. April 2013 15:13
An: typo3-dev at lists.typo3.org
Betreff: [TYPO3-dev] Extbase mapping "pages" table
Hi,
in one of my extensions I would like to get the list of pages that are
siblings of the one I put a plugin into.
I created a model class "Pagina" in the file
/Classes/Domain/Model/Pagina.php:
namespace MyCompany\MyExtension\Domain\Model:
class Pagina extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
protected $title;
public function getTitle() {
return $this->title;
}
public function setTitle($title) {
$this->title = $title;
}
}
I created a repository class "PaginaRepository" in the file
/Classes/Domain/Repository/PaginaRepository.php:
namespace MyCompany\MyExtension\Domain\Repository;
class PaginaRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
}
I put some TS in the /Configuration/TypoScript/setup.txt:
config.tx_extbase.persistence.classes {
MyCompany/MyExtension/Domain/Model/Pagina {
mapping {
tableName = pages
columns {
title.mapOnProperty = title
}
}
}
}
Finally I tried to get all the pages (just to start) and put in my
controller:
/**
* paginaRepository
*
* @var \MyCompany\MyExtension\Domain\Repository\PaginaRepository
* @inject
*/
protected $paginaRepository;
/**
* action list
*
* @return void
*/
public function listAction() {
$pagine = $this->paginaRepository->findAll();
....
}
But when I try to see the result of the query I get:
"#1247602160: Table 'typo3.tx_myextension_domain_model_pagina' doesn't
exist: SELECT COUNT(*) FROM tx_myextension_domain_model_pagina"
What's wrong in my code ?
Thanks a lot !
Luigi.
_______________________________________________
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