You are here

class TextPropertyType in Entity Construction Kit (ECK) 7.3

PRIMITIVE PROPERTY TYPES

Hierarchy

Expanded class hierarchy of TextPropertyType

1 string reference to 'TextPropertyType'
eck_eck_property_types in ./eck.module
Implements hook_eck_property_types().

File

./eck.property_type.inc, line 156
Property types.

View source
class TextPropertyType implements PropertyTypeInterface {

  /**
   * Schema.
   */
  public static function schema() {
    $schema = array(
      'description' => 'Text',
      'type' => 'varchar',
      'not null' => TRUE,
      'default' => '',
      // Relevant only to: varchar, char, and text.
      'length' => 255,
    );
    return $schema;
  }

  /**
   * Validate.
   */
  public static function validate($value) {

    // Pretty much anything can be store in a text field even an object?
    // @TODO check what happens when trying to save an obejct to a varchar field
    // in the db.
    return TRUE;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TextPropertyType::schema public static function Schema. Overrides PropertyTypeInterface::schema 1
TextPropertyType::validate public static function Validate. Overrides PropertyTypeInterface::validate 1