[TYPO3-mvc] Lost again or my problem with mapped tx_dam
Sebastian Fischer
typo3 at fischer.im
Thu Feb 4 14:28:39 CET 2010
Hi everyone,
i need to fetch images out of dam and that's why puzzeled arount with it.
My results so fare:
- My mapping in TS
persistence {
classes {
Tx_MyExt_Domain_Model_Dam {
mapping {
tableName = tx_dam
}
}
Tx_MyExt_Domain_Model_DamCategory {
mapping {
tableName = tx_dam_cat
}
}
}
}
- a simple model Tx_MyExt_Domain_Model_Dam with category attribute
/**
* @var
Tx_Extbase_Persistence_ObjectStorage<Tx_MyExt_Domain_Model_DamCategory>
*/
protected $category;
/**
* Setter for category
*
* @param
Tx_Extbase_Persistence_ObjectStorage<Tx_MyExt_Domain_Model_DamCategory>
* @return void
*/
public function setCategory(Tx_Extbase_Persistence_ObjectStorage
$category) {
$this->category = $category;
}
/**
* Getter for category
*
* @return
Tx_Extbase_Persistence_ObjectStorage<Tx_MyExt_Domain_Model_DamCategory>
*/
public function getCategory() {
return $this->category;
}
- and a repository with following function:
/**
* Fetch images that contain given categories
*
* @param string
* @return array
*/
public function findByCategory($categoryUidList) {
$query = $this->createQuery();
$query->getQuerySettings()->setRespectStoragePage(FALSE);
$uids = explode(',', $categoryUidList);
$query->matching($query->equals('category', $uids));
return $query->execute();
}
As you know category is a foreign table with mm table. But my query ends
without result and i can't locate the problem. Is anyone around that has
a solution?
Greetings
Sebastian
More information about the TYPO3-project-typo3v4mvc
mailing list