Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions /

Search in custom DataObjects and related tables


Reply


385 Views

Avatar
Chimera

Community Member, 10 Posts

17 May 2013 at 10:38pm

Hi,

i have databese of proterties and its related attributes. I want to search in that database but i cant find proper solution. I want use fulltext search as is described in tutorial but divide it into two sections, one for pages, news and so on and the other for properties. My object structure is following. Can someone help me how to solve this ? Thanks for advices.

class Property extends DataObject {

static $db = array(
'changed' => 'SS_Datetime',
'template_id' => 'Int',
'user_id' => 'Int'
.....
);

static $has_many = array(
'Attributes' => 'PropertyAttribute'
);

.......

}

class PropertyAttribute extends DataObject {

static $db = array(
'name' => 'varchar',
'value' => 'text'
);
static $has_one = array(
'Property' => 'Property'
);

}

class PropertyHolder extends Page{
...
}

class PropertyHolder_Controller extends Page_Controller {
...
}