Commit c9235f40 authored by Νίκος Κατσαούνος's avatar Νίκος Κατσαούνος
Browse files

updated epalreadydata entity relationship

parent 9b32b840
...@@ -196,6 +196,7 @@ class EepalAdminArea extends ContentEntityBase implements EepalAdminAreaInterfac ...@@ -196,6 +196,7 @@ class EepalAdminArea extends ContentEntityBase implements EepalAdminAreaInterfac
->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE); ->setDisplayConfigurable('view', TRUE);
/*
$fields['region_to_belong'] = BaseFieldDefinition::create('integer') $fields['region_to_belong'] = BaseFieldDefinition::create('integer')
->setLabel(t('region_to_belong')) ->setLabel(t('region_to_belong'))
->setDescription(t('Περιφερειακή Διεύθυνση στην οποία ανήκει.')) ->setDescription(t('Περιφερειακή Διεύθυνση στην οποία ανήκει.'))
...@@ -216,6 +217,31 @@ class EepalAdminArea extends ContentEntityBase implements EepalAdminAreaInterfac ...@@ -216,6 +217,31 @@ class EepalAdminArea extends ContentEntityBase implements EepalAdminAreaInterfac
)) ))
->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE); ->setDisplayConfigurable('view', TRUE);
*/
$fields['region_to_belong'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('region_to_belong'))
->setDescription(t('Περιφερειακή Διεύθυνση στην οποία ανήκει.'))
->setSetting('target_type', 'eepal_region')
->setSetting('handler', 'default')
->setTranslatable(TRUE)
->setDisplayOptions('view', array(
'label' => 'hidden',
'type' => 'author',
'weight' => 0,
))
->setDisplayOptions('form', array(
'type' => 'entity_reference_autocomplete',
'weight' => 5,
'settings' => array(
'match_operator' => 'CONTAINS',
'size' => '60',
'autocomplete_type' => 'tags',
'placeholder' => '',
),
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['status'] = BaseFieldDefinition::create('boolean') $fields['status'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Publishing status')) ->setLabel(t('Publishing status'))
......
...@@ -16,12 +16,13 @@ class EepalAdminAreaViewsData extends EntityViewsData implements EntityViewsData ...@@ -16,12 +16,13 @@ class EepalAdminAreaViewsData extends EntityViewsData implements EntityViewsData
public function getViewsData() { public function getViewsData() {
$data = parent::getViewsData(); $data = parent::getViewsData();
$data['eepal_admin_area']['table']['base'] = array( /*
$data['eepal_admin_area']['table']['base'] = array(
'field' => 'id', 'field' => 'id',
'title' => $this->t('Eepal admin area'), 'title' => $this->t('Eepal admin area'),
'help' => $this->t('The Eepal admin area ID.'), 'help' => $this->t('The Eepal admin area ID.'),
); );
*/
return $data; return $data;
} }
......
...@@ -196,24 +196,27 @@ class EepalPrefecture extends ContentEntityBase implements EepalPrefectureInterf ...@@ -196,24 +196,27 @@ class EepalPrefecture extends ContentEntityBase implements EepalPrefectureInterf
->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE); ->setDisplayConfigurable('view', TRUE);
$fields['dief_to_belong'] = BaseFieldDefinition::create('integer') $fields['dief_to_belong'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('region_to_belong')) ->setLabel(t('region_to_belong'))
->setDescription(t('Περιφερειακή Διεύθυνση στην οποία ανήκει.')) ->setDescription(t('Περιφερειακή Διεύθυνση στην οποία ανήκει.'))
->setRevisionable(TRUE) ->setSetting('target_type', 'eepal_admin_area')
->setSettings(array( ->setSetting('handler', 'default')
//'max_length' => 2, ->setTranslatable(TRUE)
'text_processing' => 0,
))
//->setDefaultValue(25)
->setDisplayOptions('view', array( ->setDisplayOptions('view', array(
'label' => 'above', 'label' => 'hidden',
'type' => 'integer', 'type' => 'author',
//'weight' => -4, 'weight' => 0,
)) ))
->setDisplayOptions('form', array( ->setDisplayOptions('form', array(
'type' => 'integer', 'type' => 'entity_reference_autocomplete',
//'weight' => -4, 'weight' => 5,
)) 'settings' => array(
'match_operator' => 'CONTAINS',
'size' => '60',
'autocomplete_type' => 'tags',
'placeholder' => '',
),
))
->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE); ->setDisplayConfigurable('view', TRUE);
......
...@@ -16,11 +16,13 @@ class EepalPrefectureViewsData extends EntityViewsData implements EntityViewsDat ...@@ -16,11 +16,13 @@ class EepalPrefectureViewsData extends EntityViewsData implements EntityViewsDat
public function getViewsData() { public function getViewsData() {
$data = parent::getViewsData(); $data = parent::getViewsData();
/*
$data['eepal_prefecture']['table']['base'] = array( $data['eepal_prefecture']['table']['base'] = array(
'field' => 'id', 'field' => 'id',
'title' => $this->t('Eepal prefecture'), 'title' => $this->t('Eepal prefecture'),
'help' => $this->t('The Eepal prefecture ID.'), 'help' => $this->t('The Eepal prefecture ID.'),
); );
*/
return $data; return $data;
} }
......
...@@ -16,11 +16,13 @@ class EepalRegionViewsData extends EntityViewsData implements EntityViewsDataInt ...@@ -16,11 +16,13 @@ class EepalRegionViewsData extends EntityViewsData implements EntityViewsDataInt
public function getViewsData() { public function getViewsData() {
$data = parent::getViewsData(); $data = parent::getViewsData();
/*
$data['eepal_region']['table']['base'] = array( $data['eepal_region']['table']['base'] = array(
'field' => 'id', 'field' => 'id',
'title' => $this->t('Eepal region'), 'title' => $this->t('Eepal region'),
'help' => $this->t('The Eepal region ID.'), 'help' => $this->t('The Eepal region ID.'),
); );
*/
return $data; return $data;
} }
......
...@@ -356,68 +356,77 @@ class EepalSchool extends ContentEntityBase implements EepalSchoolInterface { ...@@ -356,68 +356,77 @@ class EepalSchool extends ContentEntityBase implements EepalSchoolInterface {
->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE); ->setDisplayConfigurable('view', TRUE);
$fields['region_edu_admin_id'] = BaseFieldDefinition::create('integer') $fields['region_edu_admin_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('ID Περιφερειακής Διεύθυνσης')) ->setLabel(t('ID Περιφερειακής Διεύθυνσης'))
->setDescription(t('Δώσε το ID της Περιφερειακής Διεύθυνσης στην οποία ανήκει.')) ->setDescription(t('Δώσε το ID της Περιφερειακής Διεύθυνσης στην οποία ανήκει.'))
->setRevisionable(TRUE) ->setSetting('target_type', 'eepal_region')
->setSettings(array( ->setSetting('handler', 'default')
//'max_length' => 2, ->setTranslatable(TRUE)
'text_processing' => 0,
))
//->setDefaultValue(25)
->setDisplayOptions('view', array( ->setDisplayOptions('view', array(
'label' => 'above', 'label' => 'hidden',
'type' => 'integer', 'type' => 'author',
//'weight' => -4, 'weight' => 0,
)) ))
->setDisplayOptions('form', array( ->setDisplayOptions('form', array(
'type' => 'integer', 'type' => 'entity_reference_autocomplete',
//'weight' => -4, 'weight' => 5,
)) 'settings' => array(
'match_operator' => 'CONTAINS',
'size' => '60',
'autocomplete_type' => 'tags',
'placeholder' => '',
),
))
->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE); ->setDisplayConfigurable('view', TRUE);
$fields['edu_admin_id'] = BaseFieldDefinition::create('integer') $fields['edu_admin_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('ID Διεύθυνσης Εκπαίδευσης')) ->setLabel(t('ID Διεύθυνσης Εκπαίδευσης'))
->setDescription(t('Δώσε το ID της Διεύθυνσης Εκπαίδευσης στην οποία ανήκει.')) ->setDescription(t('Δώσε το ID της Διεύθυνσης Εκπαίδευσης στην οποία ανήκει.'))
->setRevisionable(TRUE) ->setSetting('target_type', 'eepal_admin_area')
->setSettings(array( ->setSetting('handler', 'default')
//'max_length' => 2, ->setTranslatable(TRUE)
'text_processing' => 0,
))
//->setDefaultValue(25)
->setDisplayOptions('view', array( ->setDisplayOptions('view', array(
'label' => 'above', 'label' => 'hidden',
'type' => 'integer', 'type' => 'author',
//'weight' => -4, 'weight' => 0,
)) ))
->setDisplayOptions('form', array( ->setDisplayOptions('form', array(
'type' => 'integer', 'type' => 'entity_reference_autocomplete',
//'weight' => -4, 'weight' => 5,
)) 'settings' => array(
'match_operator' => 'CONTAINS',
'size' => '60',
'autocomplete_type' => 'tags',
'placeholder' => '',
),
))
->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE); ->setDisplayConfigurable('view', TRUE);
$fields['prefecture_id'] = BaseFieldDefinition::create('integer') $fields['prefecture_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('ID Νομαρχίας')) ->setLabel(t('ID Νομαρχίας'))
->setDescription(t('Δώσε το ID της Νομαρχίας στην οποία ανήκει.')) ->setDescription(t('Δώσε το ID της Νομαρχίας στην οποία ανήκει.'))
->setRevisionable(TRUE) ->setSetting('target_type', 'eepal_prefecture')
->setSettings(array( ->setSetting('handler', 'default')
//'max_length' => 2, ->setTranslatable(TRUE)
'text_processing' => 0,
))
//->setDefaultValue(25)
->setDisplayOptions('view', array( ->setDisplayOptions('view', array(
'label' => 'above', 'label' => 'hidden',
'type' => 'integer', 'type' => 'author',
//'weight' => -4, 'weight' => 0,
)) ))
->setDisplayOptions('form', array( ->setDisplayOptions('form', array(
'type' => 'integer', 'type' => 'entity_reference_autocomplete',
//'weight' => -4, 'weight' => 5,
)) 'settings' => array(
'match_operator' => 'CONTAINS',
'size' => '60',
'autocomplete_type' => 'tags',
'placeholder' => '',
),
))
->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE); ->setDisplayConfigurable('view', TRUE);
$fields['municipality'] = BaseFieldDefinition::create('string') $fields['municipality'] = BaseFieldDefinition::create('string')
->setLabel(t('Δήμος-Περιοχή Σχολείου')) ->setLabel(t('Δήμος-Περιοχή Σχολείου'))
......
...@@ -16,11 +16,13 @@ class EepalSchoolViewsData extends EntityViewsData implements EntityViewsDataInt ...@@ -16,11 +16,13 @@ class EepalSchoolViewsData extends EntityViewsData implements EntityViewsDataInt
public function getViewsData() { public function getViewsData() {
$data = parent::getViewsData(); $data = parent::getViewsData();
/*
$data['eepal_school']['table']['base'] = array( $data['eepal_school']['table']['base'] = array(
'field' => 'id', 'field' => 'id',
'title' => $this->t('Eepal school'), 'title' => $this->t('Eepal school'),
'help' => $this->t('The Eepal school ID.'), 'help' => $this->t('The Eepal school ID.'),
); );
*/
return $data; return $data;
} }
......
...@@ -196,24 +196,51 @@ class EepalSpecialtiesInEpal extends ContentEntityBase implements EepalSpecialti ...@@ -196,24 +196,51 @@ class EepalSpecialtiesInEpal extends ContentEntityBase implements EepalSpecialti
->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE); ->setDisplayConfigurable('view', TRUE);
$fields['specialty_id'] = BaseFieldDefinition::create('integer') $fields['epal_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('region_to_belong')) ->setLabel(t('Σχολείο επιλογής'))
->setDescription(t('Περιφερειακή Διεύθυνση στην οποία ανήκει.')) ->setDescription(t('Σχολείο επιλογής.'))
->setRevisionable(TRUE) ->setSetting('target_type', 'eepal_school')
->setSettings(array( ->setSetting('handler', 'default')
//'max_length' => 2, ->setTranslatable(TRUE)
'text_processing' => 0,
))
//->setDefaultValue(25)
->setDisplayOptions('view', array( ->setDisplayOptions('view', array(
'label' => 'above', 'label' => 'hidden',
'type' => 'integer', 'type' => 'author',
//'weight' => -4, 'weight' => 0,
)) ))
->setDisplayOptions('form', array( ->setDisplayOptions('form', array(
'type' => 'integer', 'type' => 'entity_reference_autocomplete',
//'weight' => -4, 'weight' => 5,
)) 'settings' => array(
'match_operator' => 'CONTAINS',
'size' => '60',
'autocomplete_type' => 'tags',
'placeholder' => '',
),
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['specialty_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Ειδικότητα επιλογής'))
->setDescription(t('Ειδικότητα επιλογής.'))
->setSetting('target_type', 'eepal_specialty')
->setSetting('handler', 'default')
->setTranslatable(TRUE)
->setDisplayOptions('view', array(
'label' => 'hidden',
'type' => 'author',
'weight' => 0,
))
->setDisplayOptions('form', array(
'type' => 'entity_reference_autocomplete',
'weight' => 5,
'settings' => array(
'match_operator' => 'CONTAINS',
'size' => '60',
'autocomplete_type' => 'tags',
'placeholder' => '',
),
))
->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE); ->setDisplayConfigurable('view', TRUE);
......
...@@ -16,11 +16,13 @@ class EepalSpecialtiesInEpalViewsData extends EntityViewsData implements EntityV ...@@ -16,11 +16,13 @@ class EepalSpecialtiesInEpalViewsData extends EntityViewsData implements EntityV
public function getViewsData() { public function getViewsData() {
$data = parent::getViewsData(); $data = parent::getViewsData();
/*
$data['eepal_specialties_in_epal']['table']['base'] = array( $data['eepal_specialties_in_epal']['table']['base'] = array(
'field' => 'id', 'field' => 'id',
'title' => $this->t('Eepal specialties in epal'), 'title' => $this->t('Eepal specialties in epal'),
'help' => $this->t('The Eepal specialties in epal ID.'), 'help' => $this->t('The Eepal specialties in epal ID.'),
); );
*/
return $data; return $data;
} }
......
...@@ -16,11 +16,13 @@ class EepalSpecialtyViewsData extends EntityViewsData implements EntityViewsData ...@@ -16,11 +16,13 @@ class EepalSpecialtyViewsData extends EntityViewsData implements EntityViewsData
public function getViewsData() { public function getViewsData() {
$data = parent::getViewsData(); $data = parent::getViewsData();
/*
$data['eepal_specialty']['table']['base'] = array( $data['eepal_specialty']['table']['base'] = array(
'field' => 'id', 'field' => 'id',
'title' => $this->t('Eepal specialty'), 'title' => $this->t('Eepal specialty'),
'help' => $this->t('The Eepal specialty ID.'), 'help' => $this->t('The Eepal specialty ID.'),
); );
*/
return $data; return $data;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment