Bolt\Storage\Collection\Taxonomy::getOriginal PHP Method

getOriginal() public method

This loops over the existing collection to see if the properties in the incoming are already available on a saved record. To do this it checks the three key properties content_id, taxonomytype and slug, if there's a match it returns the original, otherwise it returns the new and adds the new one to the collection.
public getOriginal ( $entity ) : mixed | null
$entity
return mixed | null
    public function getOriginal($entity)
    {
        foreach ($this as $k => $existing) {
            if ($existing->getContent_id() == $entity->getContent_id() && $existing->getTaxonomytype() == $entity->getTaxonomytype() && $existing->getSlug() == $entity->getSlug()) {
                return $existing;
            }
        }
        return $entity;
    }