Search

In Silverstripe and CakePHP you can define data models by typing out objects and their relationships. I've used it in Silverstripe and found it to be a nice way of working.

Here's a Silverstripe example:

class Product extends DataObject
{
    static $db = array(
        'Title' => 'Varchar(255)',
        'Description' => 'HTMLText',
        'Price' => 'Decimal(6,2)',
        'URLSegment' => 'Varchar(255)'
    );

    //Set our defaults
    static $defaults = array(  
        'Title' => 'New Product',
        'URLSegment' => 'new-product'
    );

    static $has_one = array(
        'Image' => 'Image'
    );

    //Relate to the category pages
    static $belongs_many_many = array(
        'Categories' => 'CategoryPage'
    );

    //Fields to show in ModelAdmin table
    static $summary_fields = array(
        'Title' => 'Title',
        'URLSegment' => 'URLSegment',
        'Price' => 'Price (£)'
    ); 

    //Add an SQL index for the URLSegment
    static $indexes = array(
        "URLSegment" => true
    ); 
}

I was wondering if there is any way to do this in Symphony, or if there are plans for it in the future.

Thanks.

The next milestone release of Symphony allows you to build your sections via XML instead of the UI.

Thanks brendo. Great!

Will you be able to define relationships between fields in this way? E.g. define that section 'Product' has a checkbox field that relates to a 'Name' field in section 'Categories'?

Any rough guestimate on when the next milestone release might be?

Will you be able to define relationships between fields in this way? E.g. define that section 'Product' has a checkbox field that relates to a 'Name' field in section 'Categories'?

From what I remember, yes this is possible. It's not as natural as your example, but I think that was because it was still being defined.

Any rough guestimate on when the next milestone release might be?

Probably looking at Q1 '12 to be honest, there has been a lot of discussion over the last couple of months about key issues and what not that are on Symphony's radar, so it's definitely in the works but our energy is spread fairly thin at the moment :)

In the mean time can't you use the symphony shell extension to create fields by typing them in the terminal rather then clicking in the GUI?

Thanks for the indications, brendo. If I was a programmer I'd be up for helping, and I understand development takes time.

In the mean time can't you use the symphony shell extension to create fields by typing them in the terminal rather then clicking in the GUI?

I think it was one of your comments, newnomad, that referred to this extension that prompted my question above. I'll get it installed and have a go.

Update: I've just been informed by Nick who has been playing with it that the shell extension doesn't do field creation.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details