Decide if content item can be loaded by checking item activity if needed

@param array $data
@param bool  $checkIfActive

@return array | null
330611
protected function filterInactive($data, $checkIfActive = false)
    {
        return $data && (!$checkIfActive || ($checkIfActive && $data['OXACTIVE']) == '1') ? $data : null;
    }
995126
protected function checkInactive()
    {
        if ($this->user->status_id !== Status::INACTIVE) {
            return true;
        }

        return $this->addAction('Activate', 'check-square-o', $this->makeRoute('activate', 0));
    }
493451
protected function checkMatchArray(array $data, array $matchArray): bool
    {
        $result = true;
        foreach ($matchArray as $name => $value) {
            if (isset($data[$name])) {
                if (is_array($value)) {
                    $result = $this->checkMatchArray($data[$name], $value);
                    if ($result === false) {
                        return false;
                    }
                } elseif ($data[$name] === $value) {
                    $result = (bool)($result & true);
                } else {
                    return false;
                }
            } else {
                return false;
            }
        }
        return $result;
    }
318068
protected function getCheckedState($row, $data)
	{
		return ($this->value === null)
			? CHtml::value($data, $this->name)
			: $this->evaluateExpression($this->value, array('data' => $data, 'row' => $row));
	}
252556
public function make( array $data = null )
    {

        if( !$this->makeableSafetyCheck() ) {
            return null;
        }

        $entity = $this->entityFactory();
        if( $data !== null ) {
            $entity->set(
                $data,
                // as data is a array the second argument doesn't make much sense here
                null,
                // set the inital values and see that the correct input validation happens
                $entity->inputValidate
             );
        }
        return $entity;

    }
803895
private function checkChecksum(&$content, $id, $realNameId, &$checksumAdded) {
        if ($this->identifiersAi[$realNameId][self::CHECKSUM]) {
            $nbCharContent = strlen($content);
            $minlengthContent = $this->identifiersAi[$realNameId][self::MINLENGTH];
            if ($nbCharContent === ($minlengthContent - 1)) {
                /* we need to calculate the checksum */
                $content .= self::getAiContentChecksum($content);
                $checksumAdded++;
            } elseif ($nbCharContent === $minlengthContent) {
                /* we need to check the checksum */
                $checksum = self::getAiContentChecksum(substr($content, 0, -1));
                if (intval($content[$nbCharContent - 1]) !== $checksum) {
                    throw new CINParseException('gs1128', 'The checksum of "(' . $id . ') ' . $content . '" must be: ' . $checksum);
                }
            }
        }

        return true;
    }
1343893
public function inboundText( $data=null ){
		if(!$data) $data = $_GET;

		if(!isset($data['text'], $data['msisdn'], $data['to'])) return false;

		// Get the relevant data
		$this->to = $data['to'];
		$this->from = $data['msisdn'];
		$this->text = $data['text'];
		$this->network = (isset($data['network-code'])) ? $data['network-code'] : '';
		$this->message_id = $data['messageId'];

		// Flag that we have an inbound message
		$this->inbound_message = true;

		return true;
	}
1129176
function getContentItemSelection($data=false)
    {
        if ( ! $data ) $data = LTIX::ltiRawParameter('data');
        return parent::getContentItemSelection($data);
    }
1278161
public function used(array $condition, array $data)
    {
        if (!isset($data['rule']['used'])) {
            return false;
        }

        return $this->compare($data['rule']['used'], $condition['value'], $condition['operator']);
    }
306009
protected function isChoiceActive($key, ViewData $data, $activeName)
    {
        if ($data->getState()->isActive()) {
            $value = $data->getState()->getValue();

            if (isset($value[$activeName]) && $key == $value[$activeName]) {
                return true;
            }
        }

        return false;
    }
346728
public function check($value, IValidationData $data = null) {
        if (is_string($value)) {
            return filter_var($value, FILTER_VALIDATE_EMAIL) !== false;
        }
        return false;
    }
102848
public function setData(array $data)
    {
        if (isset($data['name'])) {
            $this->setName($data['name']);
        }

        if (isset($data['active'])) {
            $this->setActive($data['active']);
        }

        return $this;
    }
455463
public function itemPageIdsFiltered($pageId, $checkLive = false, $sort = false)
    {
        $filterType = $checkLive ? 'all' : 'live';
        $sortedSuffix = '-sorted';
        $sorted = $sort ? $sortedSuffix : '';

        self::$groupPagesFiltered[$this->id] = empty(self::$groupPagesFiltered[$this->id]) ? [] : self::$groupPagesFiltered[$this->id];

        if (!array_key_exists($filterType.$sorted, self::$groupPagesFiltered[$this->id])) {

            if ($pageIds = $this->itemPageIds($checkLive, $sort)) {

                foreach ($this->blockFilters() as $blockFilter) {

                    // get data to filter by
                    $filterByBlock = Block::preload($blockFilter->filter_by_block_id);
                    $filterByContent = PageBlock::preloadPageBlockLanguage($pageId, $blockFilter->filter_by_block_id, -1, 'block_id')->content;
                    if ($filterByBlock->type == 'selectmultiple') {
                        $filterByContentArr = unserialize($filterByContent);
                        $filterByContentArr = is_array($filterByContentArr) ? $filterByContentArr : [];
                    } else {
                        $filterByContentArr = [$filterByContent];
                    }
                    $filterByContentArr = array_filter($filterByContentArr, function ($filterByContentEl) {
                        return !is_null($filterByContentEl);
                    });

                    if (!empty($filterByContentArr)) {
                        // get block data for block to filter on
                        $blockType = Block::preload($blockFilter->item_block_id)->getTypeObject();

                        // run filter with filterBy content
                        $filteredPageIds = [];
                        foreach ($pageIds as $groupPageId) {
                            foreach ($filterByContentArr as $filterByContentEl) {
                                $groupPageBlockContent = PageBlock::preloadPageBlockLanguage($groupPageId, $blockFilter->item_block_id, -1)->content;
                                if ($blockType->filter($groupPageBlockContent, $filterByContentEl, '=')) {
                                    $filteredPageIds[] = $groupPageId;
                                    break;
                                }
                            }
                        }

                        $pageIds = $filteredPageIds;
                    }

                }

            }

            self::$groupPagesFiltered[$this->id][$filterType.$sorted] = $pageIds;
        }

        return self::$groupPagesFiltered[$this->id][$filterType.$sorted];
    }
191975
public function itemId(array $condition, array $data)
    {
        if (!isset($data['product_id']) || !isset($data['bundle'])) {
            return false;
        }

        if (!is_array($data['bundle'])) {
            $data['bundle'] = explode(',', (string) $data['bundle']);
        }

        return $this->compare($data['bundle'], $condition['value'], $condition['operator']);
    }
1136808
public function webhook(array $data = []): ?array
    {
        $validated = $this->validateAgainstSignature($data, $this->client->getSignatureKey(), [
            'amount', 'collection_id', 'due_at', 'email', 'id', 'mobile', 'name',
            'paid_amount', 'paid_at', 'paid', 'state', 'url',
        ]);

        if ((bool) $validated) {
            return $this->filterResponse($data);
        }

        return null;
    }
228966
public function isActive(Item $item)
    {
        // Check if one of the children is active
        foreach ($item->getItems() as $child) {
            if ($this->isActive($child)) {
                return true;
            }
        }

        // Custom set active path
        if ($path = $item->getActiveWhen()) {
            return Request::is(
                $path
            );
        }

        $path = ltrim(str_replace(url('/'), '', $item->getUrl()), '/');

        return Request::is(
            $path,
            $path . '/*'
        );
    }
996252
protected function activateItems(&$item)
	{
		$hasActiveChild = false;
		if (isset($item['items'])) {
			foreach ($item['items'] as &$childItem) {
				if ($this->activateItems($childItem)) $hasActiveChild = true;
			}
		}

		$isActive = isset($item['active']) ? $item['active'] : $this->isItemActive($item);
		if (!$isActive && $hasActiveChild) $isActive = true;
		$item['active'] = $isActive;

		return $isActive;
	}