@param object $entity

@return bool
510063
public function isOdm($entity)
    {
        $annotation = $this->getClassAnnotation($entity, 'Doctrine\ODM\MongoDB\Mapping\Annotations\Document');

        if ($annotation === null) {
            return false;
        }

        return true;
    }
1059895
private function isEncryptableFile($entity)
    {
        $reflection = ClassUtils::newReflectionObject($entity);
        $classMetadata = $this->getEncryptionMetadataFor($reflection->getName());

        return $classMetadata->encryptionEnabled && $classMetadata->encryptedFile;
    }
466297
public function get($entity)
    {
        $key = $this->mapping['fieldname'];
        $valueMethod = 'get' . ucfirst($key);
        $value = $entity->$valueMethod();

        return $value;
    }
1186200
public function restored(Model $entity)
    {
        $data = [
            'database' => $this->getConnectionName(),
            'driver' => $this->getDriverName(),
        ];

        $this->dispatch($this->getRestoreTenantJob($entity, $data));

        return true;
    }
1207593
public function moveDown($entity) {
		extract($this->_config);
		$next = $model::find('first', [
					'conditions' => [
						$parent => $entity->$parent,
						$left => $entity->$right + 1
				]]);

		if ($next !== null) {
			$spanToZero = $entity->$right;
			$rangeX = ['floor' => $entity->$left, 'ceiling' => $entity->$right];
			$shiftX = ($next->$right - $next->$left) + 1;
			$rangeY = ['floor' => $next->$left, 'ceiling' => $next->$right];
			$shiftY = ($entity->$right - $entity->$left) + 1;

			$this->_updateBetween($rangeX, '-', $spanToZero, $this->_scope($entity));
			$this->_updateBetween($rangeY, '-', $shiftY, $this->_scope($entity));
			$this->_updateBetween([
				'floor' => (0 - $shiftY), 'ceiling' => 0
			], '+', $spanToZero + $shiftX, $this->_scope($entity));

			$entity->set([
				$left => $entity->$left + $shiftX, $right => $entity->$right + $shiftX
			]);
		}
		return true;
	}
1374681
protected function isValidEntityState($entity)
    {
        $entityState = $this->uow->getEntityState($entity, UnitOfWork::STATE_NEW);

        if ($entityState === UnitOfWork::STATE_NEW) {
            return false;
        }

        // If Entity is scheduled for inclusion, it is not in this collection.
        // We can assure that because it would have return true before on array check
        if ($entityState === UnitOfWork::STATE_MANAGED && $this->uow->isScheduledForInsert($entity)) {
            return false;
        }

        return true;
    }
805351
public function isInIdentityMap($entity)
    {
        $oid = spl_object_hash($entity);

        if ( ! isset($this->entityIdentifiers[$oid])) {
            return false;
        }

        $classMetadata = $this->em->getClassMetadata(get_class($entity));
        $idHash        = implode(' ', $this->entityIdentifiers[$oid]);

        if ($idHash === '') {
            return false;
        }

        return isset($this->identityMap[$classMetadata->rootEntityName][$idHash]);
    }
1212077
public function isEqualTo(EntityInterface $entity)
    {
        if ($entity->getType() !== $this->getType()) {
            return false;
        }

        if ($this->getType()->getAttributes()->getSize() !== $this->value_holder_map->getSize()) {
            return false;
        }

        foreach ($this->getType()->getAttributes()->getKeys() as $attribute_name) {
            $value_holder = $this->value_holder_map->getItem($attribute_name);
            if (!$value_holder->sameValueAs($entity->getValue($attribute_name))) {
                return false;
            }
        }

        return true;
    }
1092237
public function eql($entity)
    {
        if ($entity instanceof AnDomainEntityProxy) {
            $object = $entity->getObject();
        } elseif ($entity instanceof AnMixinAbstract) {
            $object = $entity->getMixer();
        } else {
            $object = $entity;
        }

        return $this === $object;
    }
2383
public function hasDocumentDeclaration($entity)
    {
        if ($rootDocument = $this->getClassAnnotation($entity, self::DOCUMENT_CLASS)) {
            return true;
        }

        if ($this->isNested($entity)) {
            return true;
        }

        return false;
    }
983650
private function hashEntity($entity)
    {
        $class = ClassUtils::getClass($entity);

        $ids = $this->em->getClassMetadata($class)->getIdentifierValues($entity);

        return $class.spl_object_hash($entity).reset($ids);
    }
1049834
public function findByEntityInstance($entity)
    {
        $businessEntity = null;
        $class = new \ReflectionClass($entity);
        while (!$businessEntity && $class && $class->name !== null) {
            $businessEntity = $this->findByEntityClassname($class->name);
            $class = $class->getParentClass();
        }

        return $businessEntity;
    }
239496
protected function _deleteFromTree($entity) {
		extract($this->_config);

		$span = 1;
		if ($entity->$right - $entity->$left !== 1) {
			$span = $entity->$right - $entity->$left;
			$model::remove([$parent => $entity->data($model::key())]);
		}
		$this->_update($entity->$right, '-', $span + 1, $this->_scope($entity));
		return true;
	}
1100160
protected function cartItemsCheck($entity)
    {
        return function ($item) use ($entity) {
            return $item->modelType == get_class($entity) &&
                $item->modelId == $entity->{$entity->getKeyName()}
            ;
        };
    }
152810
protected function entityToString($entity)
    {
        return method_exists($entity, '__toString') ? (string) $entity : get_class($entity) . '@' . spl_object_hash($entity);
    }
728846
public function create(Entity $entity)
    {
        $result = $this->events->shouldExecute($entity, 'before', 'create');
        if (!$result) {
            return false;
        }
        $result = $this->doCreate($entity);
        $this->events->shouldExecute($entity, 'after', 'create');
        return $result;
    }
1273080
public function isEntity( &$entity = null )
    {
        if( isset( $this->data['entity'] ) ) {
            $entity = $this->data['entity'];
            return true;
        }
        $entity = null;
        return false;
    }