@param ResourceRecord $resourceRecord

@return bool
16970
public function remove(ResourceRecord $resourceRecord): bool
    {
        foreach ($this->resourceRecords as $key => $_item) {
            if ($_item === $resourceRecord) {
                unset($this->resourceRecords[$key]);

                return true;
            }
        }

        return false;
    }
898483
public static function compareResourceRecords(ResourceRecord $a, ResourceRecord $b): int
    {
        if ($a->getType() === $b->getType()) {
            return strcmp($a->getName().$a->getRdata()->output(), $b->getName().$b->getRdata()->output());
        }

        $_a = array_search($a->getType(), self::$order);
        $_b = array_search($b->getType(), self::$order);

        if (false !== $_a && false !== $_b) {
            return $_a - $_b;
        }

        if (false === $_a) {
            return 1;
        }

        return -1;
    }
1191826
public static function ResourceLoaderRegisterModules( \ResourceLoader $rl ){
		self::$_modulesRegistered = true;
		$rl->register( self::$modules );
    return true;
	}
278194
public function checkIsPublished(ActiveRecord $translationRecord)
    {
        if ($this->translationPublishedAttribute === false) {
            return true;
        }
        return
            $translationRecord->getAttribute($this->translationPublishedAttribute)
            == $this->translationPublishedAttributeValue;
    }
646910
function resourceHandler( $resourceName )
    {
        if ( isset( $this->Resources[$resourceName] ) &&
             is_object( $this->Resources[$resourceName] ) )
        {
            return $this->Resources[$resourceName];
        }
        return $this->DefaultResource;
    }
359082
protected function isPropertyEmbedded(string $property, string $resourceClass): bool
    {
        return false !== strpos($property, '.') && $this->getClassMetadata($resourceClass)->hasField($property);
    }
190784
public function loadResourceLink($resourceLink)
    {

        $ok = false;
        if (!empty($resourceLink->getRecordId())) {
            $sql = sprintf('SELECT resource_link_pk, context_pk, consumer_pk, lti_resource_link_id, settings, primary_resource_link_pk, share_approved, created, updated ' .
                           "FROM {$this->dbTableNamePrefix}" . DataConnector::RESOURCE_LINK_TABLE_NAME . ' ' .
                           'WHERE (resource_link_pk = %d)',
                           $resourceLink->getRecordId());
        } else if (!empty($resourceLink->getContext())) {
            $sql = sprintf('SELECT resource_link_pk, context_pk, consumer_pk, lti_resource_link_id, settings, primary_resource_link_pk, share_approved, created, updated ' .
                           "FROM {$this->dbTableNamePrefix}" . DataConnector::RESOURCE_LINK_TABLE_NAME . ' ' .
                           'WHERE (context_pk = %d) AND (lti_resource_link_id = %s)',
                           $resourceLink->getContext()->getRecordId(), DataConnector::quoted($resourceLink->getId()));
        } else {
            $sql = sprintf('SELECT r.resource_link_pk, r.context_pk, r.consumer_pk, r.lti_resource_link_id, r.settings, r.primary_resource_link_pk, r.share_approved, r.created, r.updated ' .
                           "FROM {$this->dbTableNamePrefix}" . DataConnector::RESOURCE_LINK_TABLE_NAME . ' r LEFT OUTER JOIN ' .
                           $this->dbTableNamePrefix . DataConnector::CONTEXT_TABLE_NAME . ' c ON r.context_pk = c.context_pk ' .
                           ' WHERE ((r.consumer_pk = %d) OR (c.consumer_pk = %d)) AND (lti_resource_link_id = %s)',
                           $resourceLink->getConsumer()->getRecordId(), $resourceLink->getConsumer()->getRecordId(), DataConnector::quoted($resourceLink->getId()));
        }
        $rsContext = mysql_query($sql);
        if ($rsContext) {
            $row = mysql_fetch_object($rsContext);
            if ($row) {
                $resourceLink->setRecordId(intval($row->resource_link_pk));
                if (!is_null($row->context_pk)) {
                    $resourceLink->setContextId(intval($row->context_pk));
                } else {
                    $resourceLink->setContextId(null);
                }
                if (!is_null($row->consumer_pk)) {
                    $resourceLink->setConsumerId(intval($row->consumer_pk));
                } else {
                    $resourceLink->setConsumerId(null);
                }
                $resourceLink->ltiResourceLinkId = $row->lti_resource_link_id;
                $settings = unserialize($row->settings);
                if (!is_array($settings)) {
                    $settings = array();
                }
                $resourceLink->setSettings($settings);
                if (!is_null($row->primary_resource_link_pk)) {
                    $resourceLink->primaryResourceLinkId = intval($row->primary_resource_link_pk);
                } else {
                    $resourceLink->primaryResourceLinkId = null;
                }
                $resourceLink->shareApproved = (is_null($row->share_approved)) ? null : (intval($row->share_approved) === 1);
                $resourceLink->created = strtotime($row->created);
                $resourceLink->updated = strtotime($row->updated);
                $ok = true;
            }
        }

        return $ok;

    }
452718
protected function hasRequiredData($mappedrecord)
    {
        if (!is_array($mappedrecord) || empty($mappedrecord) || !array_filter($mappedrecord)) {
            return false;
        }
        foreach ($this->transforms as $field => $t) {
            if (
                is_array($t) &&
                isset($t['required']) &&
                $t['required'] === true &&
                (!isset($mappedrecord[$field]) ||
                empty($mappedrecord[$field]))
            ) {
                return false;
            }
        }
        
        return true;
    }
26867
public function checkPrivilegeRequest($privilege, $resource)
    {
        $em = $this->getEntityManager();
        $privilege = trim($privilege);
        $resource = trim($resource);
        // Check the input values.
        if ($resource === '' || $privilege === '') {
            return false;
        }
        // Try to find the privilege request in the database.
        $requestedPrivilege = $em->getRepository('JaztecAcl\Entity\Monitor\RequestedPrivilege')->findOneBy([
            'privilege' => $privilege,
            'resource'  => $resource,
        ]);
        if ($requestedPrivilege instanceof \JaztecAcl\Entity\Monitor\RequestedPrivilege) {
            return true;
        }
        // Create the privilege request.
        $newRequestedPrivilege = new \JaztecAcl\Entity\Monitor\RequestedPrivilege();
        $newRequestedPrivilege
            ->setPrivilege($privilege)
            ->setResource($resource);
        $em->persist($newRequestedPrivilege);
        $em->flush();
        return true;
    }
1279661
public function index($resourceId)
    {
        $parameters = $this->request->getParameters();
        $paginator = $this->repository
        ->setResource($resourceId)
        ->setRelation($this->relation())
        ->getPaginatedCollection($parameters);
        return $this->paginatedResponse($paginator);
    }
98295
public function deletePermissions($resourceId)
    {
        $rules = $this->aclDataService->getRulesByResource($resourceId)
            ->getData();
        /** @var \RcmUser\Acl\Entity\AclRole $role */
        foreach ($rules as $rule) {
            $result = $this->aclDataService->deleteRule($rule);

            if (!$result->isSuccess()) {
                return false;
            }
        }

        return true;
    }
983263
protected function isPropertyEnabled(string $property, string $resourceClass): bool
    {
        if (null === $this->properties) {
            // to ensure sanity, nested properties must still be explicitly enabled
            return !$this->isPropertyNested($property, $resourceClass);
        }

        return \array_key_exists($property, $this->properties);
    }
517121
public function hasLinkTo(ResourceNode $parent, ResourceNode $target)
    {
        $nodes = $this->resourceNodeRepo
            ->findBy(array('parent' => $parent, 'class' => 'Claroline\CoreBundle\Entity\Resource\ResourceShortcut'));

        foreach ($nodes as $node) {
            $shortcut = $this->getResourceFromNode($node);
            if ($shortcut->getTarget() == $target) {
                return true;
            }
        }

        return false;
    }
701841
protected function isIdentifier(string $resourceClass, string $property): bool
    {
        return $property === $this->identifierExtractor->getIdentifierFromResourceClass($resourceClass);
    }
819721
public static function fromResourceLink($resourceLink, $ltiUserId)
    {

        $user = new User();
        $user->resourceLink = $resourceLink;
        if (!is_null($resourceLink)) {
            $user->resourceLinkId = $resourceLink->getRecordId();
            $user->dataConnector = $resourceLink->getDataConnector();
        }
        $user->ltiUserId = $ltiUserId;
        if (!empty($ltiUserId)) {
            $user->load();
        }

        return $user;

    }
588842
public function hasRights(ResourceNode $resourceNode, array $userRoles): bool
    {
        $isAdmin = false;

        if ($workspace = $resourceNode->getWorkspace()) {
            $isAdmin = $this->security->isGranted('administrate', $workspace);
        }

        return 0 !== $this->rightsManager->getMaximumRights($userRoles, $resourceNode) || $isAdmin;
    }
494478
public function can($action, $resource = null, $resourceId = null)
    {
        $this->assertLockInstanceIsSet();

        return $this->lock->can($action, $resource, $resourceId);
    }