[TYPO3-dev] property Mappe, tt_adress
Christian Tauscher
christian.tauscher at media-distillery.de
Sat Mar 28 09:58:31 CET 2015
Hello.
english/german group did not solve the problem, so I giv it a try here:
I want to use the tt_address table in my EXT. Easy? NO!
TYPO3 6.2, all Caches are cleared, confg.no_cache ist set and a 'rm -R
typo3temp/Cache/*' is done. Even the cache-tables are cleared via
phpmyadmin.
I get the output in my view exept...
e.g. country is missing.
If I add
/**
* country
* @var country
*/
protected $country = '';
the EXT fails with:
#1264093630: Found an invalid element type declaration in %s. A type
"'country'" does not exist.
Strage: I comment out this line, leave the getter untouched. I get the
output correct.
image returns nothing.
(DB: its a tinyblob with commaseparated string, changing this to TEXT in
DB changes nothig.)
If I change the TSsetup, e.g. clearing all the mapping part I expect the
EXT to fail what does not happen. Why?
e.g. plugin.tx_screenprinting.persistence.mapping >
If I change e.g.
columns.gender.mapOnProperty = gender
to
columns.gender.mapOnProperty = first_name
I expect the first_name as ouput for gender.
Nope. Still see the original gender filed.
Next strange thing:
<f:debug>{addresses}</f:debug>
I get the fluid result, all the addresses.
the addresses contain all the fields. Should...
Missing: birthday.
Is this because the field can be negative (UX Timestamp before epoche)?
How can I solve this?
Why is
WTF is going on here? Who can help me to find my mistake.
Or is extbase/persistance still buggy in this way - I cant belive this!?
This issues become very urgent to me. Very very urgend.
All help is welcome before I und up i a concrete basis.... #-(
Christian.
TSsetup:
--------
plugin.tx_screenprinting.persistence {
storagePid = 18
classes {
Tmd\Screenprinting\Domain\Model\Address {
mapping {
tableName = tt_address
recordType = Tmd\Screenprinting\Domain\Model\Address
columns {
gender.mapOnProperty = gender
firstName.mapOnProperty = first_name
middleName.mapOnProperty = middle_name
...
AdressController.php:
---------------------
<?php
namespace Tmd\Screenprinting\Controller;
/**
* PrintitemController
*/
class AddressController extends
\TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
/**
* addressRepository
* @var \Tmd\Screenprinting\Domain\Repository\AddressRepository
* @inject
*/
protected $addressRepository = NULL;
/**
* action list
* @return void
*/
public function listAction() {
$addresses = $this->addressRepository->findAll();
$this->view->assign('addresses', $addresses);
}
}
Model/Address.php
-----------------
<?php
namespace Tmd\Screenprinting\Domain\Model;
class Address extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* name
* @var string
*/
protected $name = '';
/**
* first_name
* @var string
*/
protected $firstName = '';
/**
* middle_name
* @var string
*/
protected $middleName = '';
.... all the table fields....
/**
* @return string $string
*/
public function getName() {
return $this->name;
}
/**
* @param string $name
* @return void
*/
public function setName($string) {
$this->name = $string;
}
.... getter, setter, too.
}
Domain/Repository/AddressRepository.php
---------------------------------------
<?php
namespace Tmd\Screenprinting\Domain\Repository;
/**
* The repository for Address
*/
class AddressRepository extends
\TYPO3\CMS\Extbase\Persistence\Repository {}
More information about the TYPO3-dev
mailing list