You are here

class IntegerPropertyType in Entity Construction Kit (ECK) 7.3

Hierarchy

Expanded class hierarchy of IntegerPropertyType

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

File

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

View source
class IntegerPropertyType implements PropertyTypeInterface {

  /**
   * Schema.
   */
  public static function schema() {
    $schema = array(
      'description' => "Integer",
      'type' => 'int',
      'size' => 'normal',
      'not null' => TRUE,
      'default' => 0,
      // Relevant only to int and float.
      'unsigned' => FALSE,
    );
    return $schema;
  }

  /**
   * Validate.
   */
  public static function validate($value) {
    $number = filter_var($value, FILTER_VALIDATE_INT);
    return $number !== FALSE;
  }

}

Members