array( 'forename' => array( 'type' => 'varchar', 'length' => 256, 'not null' => TRUE, ), 'surname' => array( 'type' => 'varchar', 'length' => 256, 'not null' => TRUE, ), 'age' => array( 'type' => 'int', 'not null' => TRUE, ), ), ); } /** * {@inheritdoc} */ public function isEmpty() { $value = $this->get('forename')->getValue(); return $value === NULL || $value === ''; } /** * {@inheritdoc} */ static $propertyDefinitions; /** * {@inheritdoc} */ public function getPropertyDefinitions() { if (!isset(static::$propertyDefinitions)) { static::$propertyDefinitions['forename'] = array( 'type' => 'string', 'label' => t('Forename'), ); static::$propertyDefinitions['surname'] = array( 'type' => 'string', 'label' => t('Surname'), ); static::$propertyDefinitions['age'] = array( 'type' => 'integer', 'label' => t('Age'), ); } return static::$propertyDefinitions; } }