[TYPO3-mvc] Big problems (Bug?) with $query-in() (little bit urgent)
Manfred Rutschmann
manfred.rutschmann at revier.de
Mon Sep 27 10:14:08 CEST 2010
Am Mon, 27 Sep 2010 08:54:00 +0200 schrieb Xavier Perseguers:
> You don't want a IN query, but a FIND_IN_SET instead! and for
> FIND_IN_SET there is already a dedicated operator in Extbase, that's
> "contains".
>
> This leads me to wonder why Extbase is using multiple LIKE statements
> instead of FIND_IN_SET, I was sure it had been updated. Anyway, that's
> the operator you want.
>
> Best
> Xavier Perseguers
Hi Xavier,
i have played with contains, but without any succes. Take a look:
$query->matching(
$query->contains('fahrzeug',$fahrzeug)
);
brings: Uncaught TYPO3 Exception Unsupported relation for contains().
get_class($fahrzeug); echo`s Tx_RkCamperchecker_Domain_Model_Fahrzeug,
thats the right one.
In tca:
"fahrzeug" => Array (
"exclude" => 1,
"label" => "LLL:EXT:...",
"config" => Array (
"type" => "group",
"internal_type" => "db",
"allowed" => "tx_rkcamperchecker_domain_model_fahrzeug",
"size" => 10,
"minitems" => 0,
"maxitems" => 99,
)
),
The model of the object with the repository:
/**
* fahrzeug
* @var Tx_RkCamperchecker_Domain_Model_Fahrzeug $fahrzeug
* @lazy
*/
protected $fahrzeug;
/**
* Set the fahrzeug value
* @param Tx_RkCamperchecker_Domain_Model_Fahrzeug $fahrzeug
*/
public function setFahrzeug( $param_fahrzeug ) {
$this->fahrzeug = $param_fahrzeug;
}
/**
* Returns the fahrzeug value.
* @return Tx_RkCamperchecker_Domain_Model_Fahrzeug
*/
public function getFahrzeug() {
if($this->fahrzeug instanceof Tx_Extbase_Persistence_LazyLoadingProxy) {
$this->fahrzeug->_loadRealInstance();
}
return $this->fahrzeug;
}
I think the whole things setup is right...?
Thanks Manne
More information about the TYPO3-project-typo3v4mvc
mailing list