LtiToolProviderProvision.php in LTI Tool Provider 2.x
File
modules/lti_tool_provider_provision/src/Entity/LtiToolProviderProvision.php
View source
<?php
namespace Drupal\lti_tool_provider_provision\Entity;
use Drupal\Core\Entity\ContentEntityBase;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
class LtiToolProviderProvision extends ContentEntityBase implements ContentEntityInterface {
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) : array {
$fields = parent::baseFieldDefinitions($entity_type);
$fields['consumer_id'] = BaseFieldDefinition::create('string')
->setLabel(t('Consumer Id'))
->setSettings([
'max_length' => 512,
'text_processing' => 0,
]);
$fields['context_id'] = BaseFieldDefinition::create('string')
->setLabel(t('Context Id'))
->setSettings([
'max_length' => 512,
'text_processing' => 0,
]);
$fields['context_label'] = BaseFieldDefinition::create('string')
->setLabel(t('Context Label'))
->setSettings([
'max_length' => 512,
'text_processing' => 0,
]);
$fields['context_title'] = BaseFieldDefinition::create('string')
->setLabel(t('Context Title'))
->setSettings([
'max_length' => 512,
'text_processing' => 0,
]);
$fields['resource_link_id'] = BaseFieldDefinition::create('string')
->setLabel(t('Resource Link Id'))
->setSettings([
'max_length' => 512,
'text_processing' => 0,
]);
$fields['resource_link_title'] = BaseFieldDefinition::create('string')
->setLabel(t('Resource Link Label'))
->setSettings([
'max_length' => 512,
'text_processing' => 0,
]);
$fields['provision_type'] = BaseFieldDefinition::create('string')
->setLabel(t('Provision Type'))
->setSettings([
'max_length' => 512,
'text_processing' => 0,
]);
$fields['provision_bundle'] = BaseFieldDefinition::create('string')
->setLabel(t('Provision Bundle'))
->setSettings([
'max_length' => 512,
'text_processing' => 0,
]);
$fields['provision_id'] = BaseFieldDefinition::create('string')
->setLabel(t('Provision Id'))
->setSettings([
'max_length' => 512,
'text_processing' => 0,
]);
return $fields;
}
}
Classes
Name |
Description |
LtiToolProviderProvision |
Plugin annotation
@ContentEntityType(
id = "lti_tool_provider_provision",
label = @Translation("LTI Tool Provider Provision Entity"),
base_table = "lti_tool_provider_provision",
fieldable = FALSE,
entity_keys = {
"id" = "id",
"uuid"… |