/** * @see PropertyInfoTable::setPropertyInfo * * @param Property $property * * @return array Information to be stored in the "pi_info" column of the "wb_property_info" * table. Must be an array and can contain anything that can be encoded by json_encode. */ public function buildPropertyInfo(Property $property) { $info = array(PropertyInfoStore::KEY_DATA_TYPE => $property->getDataTypeId()); $formatterUrl = $this->getFormatterUrl($property->getStatements()); if ($formatterUrl !== null) { $info[PropertyInfoStore::KEY_FORMATTER_URL] = $formatterUrl; } return $info; }
private function newCountryProperty() { $fingerprint = new Fingerprint(); $fingerprint->setLabel('en', 'country'); $fingerprint->setLabel('nl', 'land'); $fingerprint->setDescription('en', 'sovereign state of this item'); $countryProperty = new Property(new PropertyId('P17'), $fingerprint, 'wikibase-item'); $countryProperty->getStatements()->addNewStatement(new PropertyValueSnak(42, new StringValue('foobar'))); return $countryProperty; }
private function addStatements() { $this->simpleProperty->statements = $this->statementsBuilder->buildFromStatements($this->property->getStatements()); }
private function addStatementListToSerialization(Property $property, array &$serialization) { $serialization['claims'] = $this->statementListSerializer->serialize($property->getStatements()); }
private function patchProperty(Property $property, EntityDiff $patch) { $this->fingerprintPatcher->patchFingerprint($property->getFingerprint(), $patch); $property->setStatements($this->statementListPatcher->getPatchedStatementList($property->getStatements(), $patch->getClaimsDiff())); }