setValue() public method

public setValue ( $value )
示例#1
0
 /**
  * sets the value from property.
  *
  * @param mixed $value
  */
 public function setValue($value)
 {
     if ($this->propertyValue) {
         $this->propertyValue->setValue($value);
     }
     $this->value = $value;
 }
示例#2
0
 /**
  * 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);
 }
示例#3
0
 /**
  * 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);
 }