/**
  * Remove object from this collection.
  *
  * @param \Drupal\openlayers\Types\ObjectInterface $object
  *   Object instance to remove from this collection.
  */
 public function delete(ObjectInterface $object)
 {
     unset($this->objects[$object->getType() . '_' . $object->getMachineName()]);
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function addObject(ObjectInterface $object)
 {
     $this->setOption($object->getType() . 's', $this->getOption($object->getType() . 's', array()) + array($object->getMachineName()));
     $object->setWeight(count($this->getOption($object->getType() . 's', array())) + 2);
     $this->getCollection()->import(array($object));
     return $this;
 }
Exemplo n.º 3
0
 /**
  * Add object to this collection.
  *
  * @param ObjectInterface $object
  *   Object instance to add to this collection.
  */
 public function prepend(ObjectInterface $object)
 {
     $this->objects = array_merge(array($object->getType() . '_' . $object->getMachineName() => $object), $this->objects);
 }