CMTV
Well-known member
Hi!
The question is simple. I hope it is.
I have three tables:
For example. My param with
This data is stored only in
1 | 7
1 | 8
1 | 22
From specific param entity, how can I get all criteria it belongs to?
	
	
	
		
What should I write on '?????' place since I don't store connected criteria ids in
				
			The question is simple. I hope it is.
I have three tables:
criteria, params and criteria_params. The last one consists of two columns with criterion and param IDs. So it is a many-to-many relation between criteria and params. One criteria can have many params. One param can belong to any criteria.For example. My param with
param_id equals 1 belongs to 3 criteria with following ids: 7, 8, 22.This data is stored only in
criteria_params table:1 | 7
1 | 8
1 | 22
From specific param entity, how can I get all criteria it belongs to?
		PHP:
	
	// Param entity class
$structure->relations = [
    'Criteria' => [
        'entity' => 'PHPCriteria:Criterion',
        'type' => self::TO_MANY,
        'conditions' => ?????
    ]
];What should I write on '?????' place since I don't store connected criteria ids in
params table? They are in the criteria_params table.
			
				Last edited: 
			
		
	
								
								
									
	
								
							
							 
 
		 
 
		 
 
		 
 
		 
 
		