public function getOriginal($entity)
    {
        /** @var Entity\Taxonomy $existing */
        foreach ($this as $k => $existing) {
            if (
                $existing->getContentId() === $entity->getContentId() &&
                $existing->getTaxonomytype() === $entity->getTaxonomytype() &&
                $existing->getSlug() === $entity->getSlug()
            ) {
                return $existing;
            }
        }

        return $entity;
    }
public function getOriginal($entity)
    {
        /** @var Entity\Taxonomy $existing */
        foreach ($this as $k => $existing) {
            if (
                $existing->getContentId() === $entity->getContentId() &&
                $existing->getTaxonomytype() === $entity->getTaxonomytype() &&
                $existing->getSlug() === $entity->getSlug()
            ) {
                return $existing;
            }
        }

        return $entity;
    }
public function getOriginal ( $ entity ) { /** @var Entity\Taxonomy $existing */ foreach ( $ this as $ k => $ existing ) { if ( $ existing -> getContentId ( ) === $ entity -> getContentId ( ) && $ existing -> getTaxonomytype ( ) === $ entity -> getTaxonomytype ( ) && $ existing -> getSlug ( ) === $ entity -> getSlug ( ) ) { return $ existing ; } } return $ entity ; }
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.

@param Entity\Taxonomy $entity

@return mixed|null
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 .