Mutator for the cosignatoryOf object collection.

@return \NEM\Models\ModelCollection
4269
public function cosignatoryOf(array $data = null)
    {
        $multisigs = $data ?: $this->getAttribute("cosignatoryOf") ?: [];
        return (new CollectionMutator())->mutate("account", $multisigs);
    }
1266584
public function first() {
    $matches = [];
    if (!empty($this->nodes)) {
      $matches[] = $this->nodes[0];
    }
    return new NodeCollection($matches, FALSE);
  }
410339
protected function getCollection()
    {
        $collection = [];

        $class = $this->getCollectionClassName();
        if ($class) {
            /** @var Collection $collection */
            $collection = new $class();
            $collection->setModel($this->class);
            $collection->setFormatter($this);
        }

        return $collection;
    }
838407
public function keys(): CollectionInterface
    {
        return $this->wrap(function (Iterator $data) {
            foreach ($data as $key => $value) {
                yield $key;
            }
        });
    }
487092
public function mapRelatives()
    {
        $relations = collect($this->relations());

        if ($relations->isEmpty()) {
            return false;
        }

        return $this->items = collect($this->all())
            ->map(function ($value, $key) use ($relations) {
                if ($relations->has($key)) {
                    $className = $relations->get($key);

                    return new $className($value);
                }

                return $value;
            })
            ->all();
    }
1332198
public function CloneInstance()
	{
		$result = new IDFilterNodeIterator( $this->context, $this->type );
		$result->IDRef = $this->IDRef;
		$result->iterator = $this->iterator->CloneInstance();
		$result->Reset();
		return $result;
	}
200740
private function generate() : Collection
    {
        if (! $this->cache) {
            $this->cache = $this->components
                ->map(function ($classes, $name) {
                    return (new ComponentStatistics($name, $classes))->toArray();
                })
                ->sortBy(function ($component, $_) {
                    return Str::contains($component['component'], 'Test') ? 1 : $component['component'];
                });
        }

        return $this->cache;
    }
896735
public static function modify()
    {
        $instance = static::inst();
        if ($instance instanceof MutableConfigCollectionInterface) {
            return $instance;
        }

        // By default nested configs should become mutable
        $instance = static::nest();
        if ($instance instanceof MutableConfigCollectionInterface) {
            return $instance;
        }

        throw new InvalidArgumentException("Nested config could not be made mutable");
    }
1008097
public function generateCollectionLinks()
    {
        $links = [
            'self' => $this->getPaginator()->getSelf(),
        ];

        if ($first = $this->getPaginator()->getFirst()) {
            $links['first'] = $first;
        }

        if ($previous = $this->getPaginator()->getPrevious()) {
            $links['previous'] = $previous;
        }

        if ($next = $this->getPaginator()->getNext()) {
            $links['next'] = $next;
        }

        if ($last = $this->getPaginator()->getLast()) {
            $links['last'] = $last;
        }

        return $links;
    }
417124
public function CloneInstance()
	{
		return new ForIterator( $this->owner, $this->provider, $this->dataPool, $this->baseIter );
	}
687751
public function natsort(): Collection
    {
        $index = 0;
        $items = $this->items;

        foreach ($items as &$item) {
            $item = [$index++, $item];
        }

        uasort($items, function ($a, $b) {
            $result = strnatcmp($a[1], $b[1]);

            return $result === 0 ? $a[0] - $b[0] : $result;
        });

        foreach ($items as &$item) {
            $item = $item[1];
        }

        return new static($items);
    }
11662
public function children()
    {
        if ($this->readonlyCollection === null) {
            $this->readonlyCollection = new ReadonlyObjectCollection(
                $this->writableChildren()
            );
        }

        return $this->readonlyCollection;
    }
1049393
public function nest()
    {
        $parentColumn = $this->parentColumn;
        if (!$parentColumn) {
            return $this;
        }

        // Set id as keys.
        $this->items = $this->getDictionary();

        $keysToDelete = [];

        // Add empty collection to each items.
        $collection = $this->each(function ($item) {
            if (!$item->{$this->childrenName}) {
                $item->{$this->childrenName} = app()->make('Illuminate\Support\Collection');
            }
        });

        // Remove items with missing ancestor.
        if ($this->removeItemsWithMissingAncestor) {
            $collection = $this->reject(function ($item) use ($parentColumn) {
                if ($item->$parentColumn) {
                    $missingAncestor = $this->anAncestorIsMissing($item);

                    return $missingAncestor;
                }
            });
        }

        // Add items to children collection.
        foreach ($collection->items as $key => $item) {
            if ($item->$parentColumn && isset($collection[$item->$parentColumn])) {
                $collection[$item->$parentColumn]->{$this->childrenName}->push($item);
                $keysToDelete[] = $item->id;
            }
        }

        // Delete moved items.
        $this->items = array_values(Arr::except($collection->items, $keysToDelete));

        return $this;
    }
616992
public function getIterator()
    {
        $array = $this->getArrayCopy();

        // Is the collection nested in the array?
        if (isset($this->collectionProperty)) {

            // Locate the collection in the response.
            $collectionFound = false;
            $property = NULL;
            foreach ((array) $this->collectionProperty as $property) {
                if (isset($array[$property])) {
                    $collectionFound = true;
                    break;
                }
            }

            if (!$collectionFound) {
                throw new \OutOfBoundsException('Collection not found in response');
            }

            $array = $array[$property];
        }

        // Build the collection.
        $collection = array();
        foreach ($array as $item) {
            $element = new $this->elementClass($item);
            $collection[(string) $element] = $element;
        }

        return new \ArrayObject($collection);
    }
698181
protected function getCollectionFromObjectByReference()
    {
        $object       = $this->getObject();
        $refl         = $this->getClassMetadata()->getReflectionClass();
        $reflProperty = $refl->getProperty($this->getCollectionName());

        $reflProperty->setAccessible(true);

        return $reflProperty->getValue($object);
    }
46274
public function collection() : EmbeddedCollectionDefiner
    {
        return new EmbeddedCollectionDefiner(
            $this->orm,
            function (callable $mapperLoader, $tableName, $primaryKeyName, $foreignKeyName) {
                call_user_func($this->callback, function (
                    $idString,
                    Table $parentTable,
                    IObjectMapper $parentMapper
                ) use (
                    $mapperLoader,
                    $tableName,
                    $primaryKeyName,
                    $foreignKeyName
                ) {
                    return new EmbeddedCollectionRelation(
                        $idString,
                        $mapperLoader($parentMapper),
                        $parentTable->getName(),
                        $this->orm->getNamespace() . $tableName,
                        $parentTable->getPrimaryKeyColumn()->withName($primaryKeyName),
                        new Column($foreignKeyName, PrimaryKeyBuilder::primaryKeyType()),
                        $parentTable->getPrimaryKeyColumn()
                    );
                });
            }
        );
    }
436011
public function getMongoCollection()
    {
        if (empty($this->collection)) {
            $mongoCollectionClassName = $this->mongoCollectionClassName;
            $this->collection = new $mongoCollectionClassName(
                $this->database->getMongoDB(),
                $this->collectionName
            );
        }

        return $this->collection;
    }