[TYPO3-mvc] documentation, and example exbase m:n relation query

Muriel le Pair typo3 at strangefruit.nl
Sun Jul 6 17:00:53 CEST 2014


Hi,

Helmut Hummel schreef op 01-07-14 11:55:
> If you have an entity e.g. "News" and it has a property "categories"
> which is an m:n relation to "Category" entities, then you could do the
> following in your "NewsRepository":
>
>
> public function findByCategory($category) {
>    $query = $this->createQuery();
>    $constraint = $query->contains('categories', $category);
>    return $query->matching($constraint)->execute();
> }
>
> While $category could either be an integer (uid) or an object of type
> "Category" entity.

Thanks, I think I understand the general concept more or less, just not 
how to get it working.

I have been looking at 
http://docs.typo3.org/typo3cms/ExtbaseFluidBook/6-Persistence/3-implement-individual-database-queries.html

And to this example: 
http://ameliasdev.wordpress.com/2014/01/29/implementing-a-filter-navigation-in-typo3-extensions-with-extbasefluid/).

It suggests to create a Demand class, but when I run the code I get a db 
error: 'tx_sffilterdb_domain_model_demand' doesn't exist, so there is 
something wrong with my mapping. But I just don't understand what.


class Demand extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
	
	/**
  	* @var 
\TYPO3\CMS\Extbase\Persistence\ObjectStorage<\SF\SfFilterdb\Domain\Model\CatSoort>
  	**/
  	protected $catSoort;
	
	/**
	 * Returns the catSoort
	 *
	 * @return 
\TYPO3\CMS\Extbase\Persistence\ObjectStorage<\SF\SfFilterdb\Domain\Model\CatSoort> 
$catSoort
	 */
	public function getCatSoort() {
		return $this->catSoort;
	}
}

In the main Items controller:
	public function ajaxListAction(\SF\SfFilterdb\Domain\Model\Demand 
$demand = NULL) {
	
	}

What am I doing wrong????

--
kind regards,

Muriel le Pair


More information about the TYPO3-project-typo3v4mvc mailing list