[TYPO3-mvc] Tx_Extbase_Persistence_Exception
Daniel Dimitrov
danielsd_bg at yahoo.fr
Fri Apr 23 12:09:28 CEST 2010
Hey List,
I'm fighting with extbase for several hours now and I have the feeling that
I'm loosing the battle :(
Actually I'm trying to do something very easy - at least it looks easy in
the blog_example.
In my case I'm not building a blog component, but a shop :)
I'm showing a list with several products. Every product has a supplier.
I tried to build the relationship between the product and the supplier with
tca and in the backend everything works. I'm able to choose a sipplier for
my product.
Here is how the tca looks like:
$TCA['tx_bwshop_domain_model_products'] = array (
'ctrl' => $TCA['tx_bwshop_domain_model_products']['ctrl'],
'interface' => array (
'showRecordFieldList' => 'hidden, supplier, title'
),
'feInterface' => $TCA['tx_bwshop_domain_model_products']['feInterface'],
'columns' => array(
'hidden' => array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
'config' => array (
'type' => 'check',
'default' => '0'
)
),
'supplier' => Array (
'label' => 'LLL:EXT:bw_securedl/locallang_db.xml:tx_bwshop_supplier',
'config' => Array (
'type' => 'select',
'foreign_table' => 'tx_bwshop_domain_model_supplier',
'maxitems' => 1,
)
),
'title' => Array (
'label' =>
'LLL:EXT:bw_securedl/locallang_db.xml:tx_bwshop_products.title',
'config' => Array (
'type' => 'input',
'size' => '30',
'eval' => 'trim',
'max' => '255',
)
),
),
'types' => array (
'0' => array('showitem' => 'supplier, title'),
),
'palettes' => array(
'1' => array('showitem' => '')
)
);
$TCA['tx_bwshop_domain_model_supplier'] = array (
'ctrl' => $TCA['tx_bwshop_domain_model_supplier']['ctrl'],
'interface' => array (
'showRecordFieldList' => 'crdate,name'
),
'columns' => array (
'name' => Array (
'label' =>
'LLL:EXT:bw_securedl/locallang_db.xml:tx_bwshop_supplier.name',
'config' => Array (
'type' => 'input',
'size' => '30',
'eval' => 'trim',
'max' => '255'
)
),
'street' => Array (
'label' =>
'LLL:EXT:bw_securedl/locallang_db.xml:tx_bwshop_supplier.street',
'config' => Array (
'type' => 'input',
'size' => '30',
'eval' => 'trim',
'max' => '255'
)
),
),
'types' => array (
'0' => array('showitem' => 'name,street'),
),
'palettes' => array (
'1' => array('showitem' => ''),
),
);
I've removed some field definitions to keep the example simple.
My products model looks like this:
class Tx_Bwshop_Domain_Model_Products extends
Tx_Extbase_DomainObject_AbstractEntity {
/**
* @var Tx_Bwshop_Domain_Model_Supplier
*/
protected $supplier;
/**
* the product's title
* @var string
*/
protected $title;
/**
* Getter for supplier
*
* @return Tx_Bwshop_Domain_Model_Supplier
*/
public function getSupplier() {
return $this->supplier;
}
public function getTitle() {
return $this->title;
}
}
and my supplier model looks like this:
class Tx_Bwshop_Domain_Model_Supplier extends
Tx_Extbase_DomainObject_AbstractEntity {
/**
* the supplier name
* @var string
*/
protected $name;
/**
* the supplier street
* @var string
*/
protected $street;
/**
* the supplier city
* @return string
*/
public function getName() {
return $this->name;
}}
those models are placed in the right location:
myext/Classes/Domain/Model/products.php
myext/Classes/Domain/Model/supplier.php
When I try to load the page I get:
Tx_Extbase_Persistence_Exception
Could not determine a Data Map for given class name.
I tried to track down the problem and what I found out was that I get this
error from here:
throw new Tx_Extbase_Persistence_Exception('Could not determine a Data Map
for given class name.', 1256067130);
in the getDataMap function.
The classname that this function gets as parameter is
Tx_Bwshop_Domain_Model_Supplier and I have this model
Any ideas what I do wrong?
Thanks in advance!
Daniel
More information about the TYPO3-project-typo3v4mvc
mailing list