Hello. A little I can not deal with recursion, namely how to build it. There are properties (for example, number of rooms, type of housing, etc.) and there are its values. I need to collect references of these values depending on the nesting of their properties.
For example (number of rooms -> type of housing -> wall material):
- 1-komnatnie
- 1-komnatnie / vtorichka
- 1-komnatnie / vtorichka / kirpichnie
Perhaps I incorrectly created the table, so I can not catch up.
- n_category - the number of the category to which the property belongs (apartments)
- value_properties - property value
- link - property link
- name - name
- n_prop - id-properties (number of rooms, type of housing, etc.)
- priority - currently does not carry any information
- parent - parent n_prop
This method turned out to finish the lack of intelligence (((
function get_data_dynamic_link($data,$parent=0){ $tree = array(); foreach ($data as $id=> $value) { $tree[] = $value['link']; //$tree[] = $this->get_data_dynamic_link($data,$value['parent']); } return $tree; } Thanks for any advice.
