You are here

function eck_get_custom_property_schema in Entity Construction Kit (ECK) 7

2 calls to eck_get_custom_property_schema()
eck__entity_type__form_submit in ./eck.entity_type.inc
Submit handler for adding and entity type.
eck__entity_type__schema in ./eck.entity_type.inc
Create the default schema for an entity type.

File

./eck.properties.inc, line 93

Code

function eck_get_custom_property_schema($property) {
  switch ($property['type']) {
    case 'text':
      $spec = array(
        //'description' => '',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      );
      break;
    case 'decimal':
      $spec = array(
        //'description' => '',
        'type' => 'float',
        'not null' => TRUE,
        'default' => 0,
      );
      break;
    case 'integer':
    case 'date':
    default:

      // Integer, date, and entities are all of type 'int'.
      $spec = array(
        //'description' => '',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      );
      break;
  }
  return $spec;
}