Checks if the entity has to be processed

@param mixed $entity
@param string $operation

@return boolean
548575
private function toProcess($entity, $operation)
    {
        switch ($operation) {
            case self::ENCRYPT:
                return !$entity->isEncrypted();
            case self::DECRYPT:
                return $entity->isEncrypted();
            default:
                return false;
        }
    }
172023
public function stream_lock(int $operation): bool
    {
        if ((LOCK_NB & $operation) == LOCK_NB) {
            $operation = $operation - LOCK_NB;
        }

        return $this->content->lock($this, $operation);
    }
818791
public function isGranted($action, $entity, array $parameters = array())
    {
        $entityType = defined(get_class($entity) . '::ENTITY_TYPE') ? $entity::ENTITY_TYPE : null;

        if (!is_null($entityType) && array_key_exists($entityType, $this->strategies) && $this->strategies[$entityType]->support($action)) {
            return  $this->strategies[$entityType]->isGranted($action, $entity, $parameters);
        }

        return true;
    }
1079715
public function beforeSave(Event $event, Entity $entity) {
		if (isset($entity['name'])) {
			$entity['name'] = ucwords($entity['name']);
		}

		return true;
	}
206177
public function removeOperation(\CampaignChain\CoreBundle\Entity\Operation $operations)
    {
        $this->operations->removeElement($operations);
    }
797712
static public function isOperation($operation) {
    return ((string) $operation == Connect2PayClient::OPERATION_TYPE_SALE ||
        (string) $operation == Connect2PayClient::OPERATION_TYPE_AUTHORIZE);
  }
1273384
protected function _ifUploaded($entity, $field)
    {
        if (array_key_exists($field, $this->_uploads)) {
            $data = $this->_uploads[$field];

            if (!empty($data['tmp_name'])) {
                return true;
            }
        }
        return false;
    }
171414
public function isRegisteredEntity($entity)
    {
        if (!is_string($entity)) {
            $entity = get_class($entity);
        }

        return array_key_exists($entity, $this->entityClasses);
    }
13313
protected function releaseLock($operation)
    {
        $exists = is_resource($this->lockHandle);

        $success = $exists && flock($this->lockHandle, $operation);

        $exists && fclose($this->lockHandle);
        $this->lockHandle = null;

        return $success;
    }
250108
public function stream_lock($operation)
    {
        if ($this->fileHandle === null) {
            return false;
        }
        self::restore();
        $success = flock($this->fileHandle, $operation);
        self::register();
        return $success;
    }
863611
public function lock($resource, int $operation): bool
    {
        if ((LOCK_NB & $operation) == LOCK_NB) {
            $operation = $operation - LOCK_NB;
        }

        // call to lock file on the same file handler firstly releases the lock
        $this->unlock($resource);

        if (LOCK_EX === $operation) {
            if ($this->isLocked()) {
                return false;
            }

            $this->setExclusiveLock($resource);
        } elseif(LOCK_SH === $operation) {
            if ($this->hasExclusiveLock()) {
                return false;
            }

            $this->addSharedLock($resource);
        }

        return true;
    }
38093
public function flush($entity = null)
    {
        if ($entity !== null) {
            $this->persist($entity);
        }

        return $this->getEntityManager()->flush();
    }
1224429
public function isSatisfiedBy(Entity $entity)
    {
        if (property_exists($entity, 'visible')) {
            return (bool)$entity->visible;
        }

        throw new InvalidArgumentException("Property 'visible' does not exist in class " . get_class($entity));
    }
511153
protected function hasChangedUsingComparisonFunction($entity) : bool
    {
        $objectHashId = spl_object_hash($entity);
        $originalData = $this->objectHashIdsToOriginalData[$objectHashId];

        return !$this->comparators[get_class($entity)]($originalData, $entity);
    }
390516
public function isOrm($entity)
    {
        $annotation = $this->getClassAnnotation($entity, 'Doctrine\ORM\Mapping\Entity');

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

        return true;
    }
426945
public function isSatisfiedBy(Entity $entity)
    {
        if (property_exists($entity, 'active')) {
            return (bool)$entity->active;
        }

        throw new InvalidArgumentException("Property 'active' does not exist in class " . get_class($entity));
    }
1206314
public function process(Transaction $transaction, $operation)
    {
        $response = parent::process($transaction, $operation);

        if ($response instanceof FailureResponse && $operation == Operation::CANCEL
            && $transaction->getBackendOperationForRefund()) {
            return parent::process($transaction, Operation::REFUND);
        } else {
            return $response;
        }
    }