Jump to:

3460 Posts in 1064 Topics by 739 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Search in custom DataObjects and related tables

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 305 Views
  • Chimera
    Avatar
    Community Member
    10 Posts

    Search in custom DataObjects and related tables Link to this post

    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 {
    ...
    }

    305 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.