public function getOriginal($entity)
    {
        $entities = $this->flatten();
        foreach ($entities as $existing) {
            if (
                $existing->getName() == $entity->getName() &&
                $existing->getGrouping() == $entity->getGrouping() &&
                $existing->getFieldname() == $entity->getFieldname() &&
                (!$existing->getBlock() || $existing->getBlock() == $entity->getBlock())
            ) {
                return $existing;
            }
        }

        return $entity;
    }
public function getOriginal($entity)
    {
        $entities = $this->flatten();
        foreach ($entities as $existing) {
            if (
                $existing->getName() == $entity->getName() &&
                $existing->getGrouping() == $entity->getGrouping() &&
                $existing->getFieldname() == $entity->getFieldname() &&
                (!$existing->getBlock() || $existing->getBlock() == $entity->getBlock())
            ) {
                return $existing;
            }
        }

        return $entity;
    }
public function getOriginal ( $ entity ) { $ entities = $ this -> flatten ( ) ; foreach ( $ entities as $ existing ) { if ( $ existing -> getName ( ) == $ entity -> getName ( ) && $ existing -> getGrouping ( ) == $ entity -> getGrouping ( ) && $ existing -> getFieldname ( ) == $ entity -> getFieldname ( ) && ( ! $ existing -> getBlock ( ) || $ existing -> getBlock ( ) == $ entity -> getBlock ( ) ) ) { 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.

@param object $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 .