示例#1
0
 /**
  * Delete a RIPE object from the RIPE database.
  * 
  * Note: the API also accepts a reason string,
  * but it is omitted for simplicity.
  * 
  * @param Object $object RIPE object.
  * @return Object The deleted object.
  */
 public function delete(Object $object, $reason = NULL)
 {
     $path = $object->getType() . '/' . $object->getPrimaryKey();
     if ($reason) {
         $this->send('DELETE', $path, ['reason' => $reason]);
     } else {
         $this->send('DELETE', $path);
     }
     return $this->getResult();
 }
示例#2
0
 /**
  * Create an Attribute. If called implicit (e.g. via setAttribute()) it 
  * will create an optional, multiple attribute on-the-fly.
  * 
  * This method can be used to create an RPSL object according to a 
  * descriptor from the metadata service.
  * 
  * @param string $name name of the attribute.
  * @param boolean $required Requirement (mandatory) of the attribute.
  * @param boolean $multiple Cardinality (multiple) of the attribute.
  * @return AttributeInterface
  */
 public function setupAttribute($name, $required = Attr::OPTIONAL, $multiple = Attr::MULTIPLE)
 {
     $this->create($name, $required, $multiple);
     // to make sure we’re not caught in a loop
     return parent::getAttribute($name);
 }