class FlexiformFormEntityNew in Flexiform 7
Form Entity that creates a new entity.
Hierarchy
- class \FlexiformFormEntityBase implements FlexiformFormEntityInterface
- class \FlexiformFormEntityNew
Expanded class hierarchy of FlexiformFormEntityNew
1 string reference to 'FlexiformFormEntityNew'
File
- includes/
form_entity/ new.form_entity.inc, line 10 - Contains class for a basic entity getter.
View source
class FlexiformFormEntityNew extends FlexiformFormEntityBase {
/**
* {@inheritdoc}
*/
public function getEntity() {
parent::getEntity();
$values = array();
// Work out if there is a bundle key.
$entity_info = entity_get_info($this->entity_type);
if (!empty($entity_info['entity keys']['bundle'])) {
$bundle_key = $entity_info['entity keys']['bundle'];
$values[$bundle_key] = $this->settings['bundle'];
}
// Make a new entity.
$entity = entity_create($this->entity_type, $values);
return $this
->checkBundle($entity) ? $entity : FALSE;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FlexiformFormEntityBase:: |
public | property | The namespace of this entity. | |
FlexiformFormEntityBase:: |
public | property | The type of this entity. | |
FlexiformFormEntityBase:: |
public | property | Details of the getter. | |
FlexiformFormEntityBase:: |
public | property | The Flexiform Entity Manager | |
FlexiformFormEntityBase:: |
public | property | The settings for this entity on the flexiform. | |
FlexiformFormEntityBase:: |
public | function | Check bundle. | |
FlexiformFormEntityBase:: |
public | function |
Get the Configuration Form. Overrides FlexiformFormEntityInterface:: |
3 |
FlexiformFormEntityBase:: |
public | function |
Submit the Configuration Form. Overrides FlexiformFormEntityInterface:: |
|
FlexiformFormEntityBase:: |
public | function |
Validate the configuration form. Overrides FlexiformFormEntityInterface:: |
|
FlexiformFormEntityBase:: |
public | function | Get a Parameter From the Entity Manager. | |
FlexiformFormEntityBase:: |
public | function | Get a Parameter's entity settings from the Entity Manager. | |
FlexiformFormEntityBase:: |
public | function | Get the entity type of a parameter. | |
FlexiformFormEntityBase:: |
public | function |
Save the entity upon submission of the form. Overrides FlexiformFormEntityInterface:: |
5 |
FlexiformFormEntityBase:: |
public | function | Construct a Flexiform Form Entity class. | |
FlexiformFormEntityNew:: |
public | function |
Get the entity for the form. Overrides FlexiformFormEntityBase:: |