public function add( IdStack $idPath, $record ) { $attributeId = $idPath->getKeyStack()->peek( 0 )->classAttributeId; $optionMeaningId = $record->optionAttributeOption; $languageId = $record->language; if ( $languageId == NULL ) { $languageId = 0 ; } if ( $optionMeaningId ) { addOptionAttributeOption( $attributeId, $optionMeaningId, $languageId ); } }
public function add( IdStack $idPath ) { global $wgOptionSuffix; if ( $this->isAddField ) { $syntransId = $idPath->getKeyStack()->peek( 0 )->syntransId; if ( ! $syntransId ) $syntransId = 0 ; // in the case of a DM option attribute, there is no syntrans in the PathId // note: it is normal that the "updateSelectOptions(" has no closing parenthesis. An additional parameter and ')' is added by the function updateSuggestValue (suggest.js) $parameters = array( "level" => $this->attributesLevelName, "definedMeaningId" => $idPath->getDefinedMeaningId(), "syntransId" => $syntransId, "annotationAttributeId" => $idPath->getAnnotationAttribute()->getId(), "onUpdate" => 'updateSelectOptions(\'' . $this->addId( $idPath->getId() ) . $wgOptionSuffix . '\',' . $syntransId ); return getSuggest( $this->addId( $idPath->getId() ), $this->suggestType(), $parameters ); } else return ''; }