Ejemplo n.º 1
0
 /**
  * @dataProvider provideLanguageCodes
  */
 public function testGetSetLabel($code)
 {
     $this->object_mono->set_label($code, 'value')->save();
     $this->assertSame('value', $this->object_mono->get_label($code));
     $this->object_mono->set_label($code, null)->save();
     $this->assertEquals($this->object_mono->get_name(), $this->object_mono->get_label($code));
     $this->object_mono->set_label($code, '')->save();
     $this->assertEquals($this->object_mono->get_name(), $this->object_mono->get_label($code));
 }
Ejemplo n.º 2
0
 /**
  * Part of the cache_cacheableInterface
  *
  * @param  string        $option
  * @return caption_field
  */
 public function delete_data_from_cache($option = null)
 {
     $this->value = $this->VocabularyId = $this->VocabularyType = null;
     $this->record->delete_data_from_cache(record_adapter::CACHE_TITLE);
     try {
         $this->record->get_caption()->get_field($this->databox_field->get_name())->delete_data_from_cache();
     } catch (\Exception $e) {
     }
     unset(self::$localCache[$this->get_cache_key($option)]);
 }
Ejemplo n.º 3
0
 /**
  * @return string
  */
 public function get_name()
 {
     return $this->databox_field->get_name();
 }
Ejemplo n.º 4
0
 /**
  * Retrieve informations about one \databox metadata field
  *
  * @param  \databox_field $databox_field
  *
  * @return array
  */
 private function list_databox_metadata_field_properties(\databox_field $databox_field)
 {
     return ['id' => $databox_field->get_id(), 'namespace' => $databox_field->get_tag()->getGroupName(), 'source' => $databox_field->get_tag()->getTagname(), 'tagname' => $databox_field->get_tag()->getName(), 'name' => $databox_field->get_name(), 'labels' => ['fr' => $databox_field->get_label('fr'), 'en' => $databox_field->get_label('en'), 'de' => $databox_field->get_label('de'), 'nl' => $databox_field->get_label('nl')], 'separator' => $databox_field->get_separator(), 'thesaurus_branch' => $databox_field->get_tbranch(), 'type' => $databox_field->get_type(), 'indexable' => $databox_field->is_indexable(), 'multivalue' => $databox_field->is_multi(), 'readonly' => $databox_field->is_readonly(), 'required' => $databox_field->is_required()];
 }