Ticket #8 (new task)

Opened 3 years ago

add attribute list management to CMS API

Reported by: demian Assigned to: demian
Priority: major Milestone:
Component: component1 Keywords:
Cc:

Description

$aList = SGL_AttributeList::getById($id);
$aList = SGL_AttributeList::getByName($name);

//  for simple lists
$aList = SGL_AttributeList::create('my attrib list')
    ->type = 'select' // or radio, or combo
    ->multiple = false
    ->data-inline = array(1 => 'foo', 2 => 'bar')
    ->save();

//  for table-driven lists
$aList = SGL_AttributeList::create('my db attrib list')
    ->type = 'select' // or radio, or combo
    ->multiple = false
    ->data-db = array(
                'listTable'  => 'countries',
                'listKey'   => 'country_id',
                'listValue' => 'country_name'
                )
    ->options = array(
                'sortBy'    => 'name',
                'sortOrder' => 'ASC',
                'limit'     => 5,
                'filters'   => array(....TBC...)
            )
    ->save();

//  or file-based lists
$aList = SGL_AttributeList::create('my file-based attrib list')
    ->type = 'select' // or radio, or combo
    ->multiple = false
    ->data-file = array(
                'type'        => 'PHP',
                'location'    => '/modules/default/data/data.attributelist.countries.php', // path from SGL_PATH
            )
    ->save();