/** * sets the value from property. * * @param mixed $value */ public function setValue($value) { if ($this->propertyValue) { $this->propertyValue->setValue($value); } $this->value = $value; }
/** * Upgrades the given property to the new URL representation. * * @param PropertyValue $property The current property value, which will be updated * @param bool $addScheme Adds the scheme to URLs if true, removes the scheme otherwise */ private function upgradeProperty(PropertyValue $property, $addScheme) { $value = $property->getValue(); if ($addScheme) { $this->upgradeUrl($value); } else { $this->downgradeUrl($value); } $property->setValue($value); }
/** * Upgrades the given property to the new URL representation. * * @param PropertyValue $property The current property value, which will be updated * @param bool $addScheme Adds the scheme to URLs if true, removes the scheme otherwise */ private function upgradeProperty(PropertyValue $property, $addScheme) { $value = $property->getValue(); if (is_array($value)) { foreach ($value as $key => $entry) { if ($entry['type'] !== 'url') { continue; } if ($addScheme) { $this->upgradeUrl($entry['url']); } else { $this->downgradeUrl($entry['url']); } $value[$key] = $entry; } } elseif ($addScheme) { $this->upgradeUrl($value); } else { $this->downgradeUrl($value); } $property->setValue($value); }