Example #1
0
 /**
  * @inheritdoc
  */
 public function offsetSet($attribute, $value)
 {
     if (in_array($attribute, ['name', 'value', 'placeholder'])) {
         $this->elements['q'][$attribute] = $value;
     }
     parent::offsetSet($attribute, $value);
 }
Example #2
0
 /**
  * Sets the value of a property.
  *
  * The attribute corresponding to the property is set.
  *
  * @param string $property
  * @param mixed $value
  */
 public function offsetSet($property, $value)
 {
     $this->element->offsetSet(self::serialize_property($property), $value);
 }
Example #3
0
 /**
  * Creates a new parameter
  *
  * @param string $name
  * @param mixed $value
  * @return void
  */
 public function offsetSet($name, $value)
 {
     if (is_int($name)) {
         parent::offsetSet($name, $value);
     }
     if (is_scalar($value)) {
         if (!is_string($name)) {
             throw new \InvalidArgumentException('A parameter name must be specified. This means you cannot use the $array[]="string" to add parameters.');
         }
         $this->offsetUnset($name);
         $parameter = new Parameter($name, $value);
         $parameter->parent = $this;
         $this->parameters[] = $parameter;
     } elseif ($value instanceof Parameter) {
         if (!is_null($name)) {
             throw new \InvalidArgumentException('Don\'t specify a parameter name if you\'re passing a \\Sabre\\VObject\\Parameter. Add using $array[]=$parameterObject.');
         }
         $value->parent = $this;
         $this->parameters[] = $value;
     } else {
         throw new \InvalidArgumentException('You can only add parameters to the property object');
     }
 }