Helper/EntityHelper.php
public function isManagedByDoctrine($entity)
    {
        $cacheKey  = 'managed';
        $entity    = $this->toString($entity);
        $isManaged = $this->getFromCache($entity, $cacheKey, null);

        if (null !== $isManaged) {
            return $isManaged;
        }

        try {
            $this->managed = $isManaged = (bool) $this->entityManager->getReference($entity, 0);
            $entity = $this->getEntityClassFull($entity);
        } catch (\Exception $e) {
            $isManaged = false;
        }

        $this->cache[$entity][$cacheKey] = $isManaged;

        return $isManaged;
    }
public function isManagedByDoctrine($entity)
    {
        $cacheKey  = 'managed';
        $entity    = $this->toString($entity);
        $isManaged = $this->getFromCache($entity, $cacheKey, null);

        if (null !== $isManaged) {
            return $isManaged;
        }

        try {
            $this->managed = $isManaged = (bool) $this->entityManager->getReference($entity, 0);
            $entity = $this->getEntityClassFull($entity);
        } catch (\Exception $e) {
            $isManaged = false;
        }

        $this->cache[$entity][$cacheKey] = $isManaged;

        return $isManaged;
    }
public function isManagedByDoctrine ( $ entity ) { $ cacheKey = 'managed' ; $ entity = $ this -> toString ( $ entity ) ; $ isManaged = $ this -> getFromCache ( $ entity , $ cacheKey , null ) ; if ( null !== $ isManaged ) { return $ isManaged ; } try { $ this -> managed = $ isManaged = ( bool ) $ this -> entityManager -> getReference ( $ entity , 0 ) ; $ entity = $ this -> getEntityClassFull ( $ entity ) ; } catch ( \ Exception $ e ) { $ isManaged = false ; } $ this -> cache [ $ entity ] [ $ cacheKey ] = $ isManaged ; return $ isManaged ; }
Returns is received entity managed by doctrine or not

@param object|string $entity Entity object or just entity name in the full or shot notation

@return bool
Returns is received entity managed by doctrine or not