示例#1
0
 /**
  * {@inheritdoc}
  */
 public function getCollection()
 {
     if (!$this->collection instanceof Collection) {
         $this->collection = \Drupal::service('openlayers.Types')->createInstance('Collection');
         $this->collection->append($this);
         $this->buildCollection();
     }
     return $this->collection;
 }
示例#2
0
文件: Object.php 项目: josemrc/ae2web
 /**
  * {@inheritdoc}
  */
 public function getCollection()
 {
     if (is_null($this->collection) || !$this->collection instanceof Collection) {
         $this->collection = \Drupal::service('openlayers.Types')->createInstance('Collection');
         $this->collection->import($this->optionsToObjects());
         $this->collection->append($this);
     }
     return $this->collection;
 }
 /**
  * Merges another collection into this one.
  *
  * @param \Drupal\openlayers\Types\Collection $collection
  *   The collection to merge into this one.
  */
 public function merge(Collection $collection)
 {
     foreach ($collection->getFlatList() as $object) {
         $this->prepend($object);
     }
 }
示例#4
0
 /**
  * Merges another collection into this one.
  *
  * @param \Drupal\openlayers\Types\Collection $collection
  *   The collection to merge into this one.
  */
 public function merge(Collection $collection)
 {
     foreach ($collection->getObjects() as $objects) {
         foreach ($objects as $object) {
             $this->append($object);
         }
     }
 }