Return an array of all entities used by the contexts
@return array of strings
975420
public function AllEntities()
	{
		// In PHP 7.0 $this is passed to closure functions automatically but not in earlier versions
		$contexts = &$this->contexts;

		$result = array_reduce( array_keys( $this->contexts ), function( $carry, $context ) use( &$contexts ) {

			if ( ! isset( $contexts[ $context ]['entity']['identifier']['value'] ) ) return $carry;

			/**
			 * @var \lyquidity\xml\QName $qname
			 */
			$qname = new QName(  null, $contexts[ $context ]['entity']['identifier']['scheme'], $contexts[ $context ]['entity']['identifier']['value'] );

			if ( isset( $carry[ $qname->clarkNotation() ] ) ) return $carry;

			$carry[ $qname->clarkNotation() ] = 1;
			return $carry;

		}, array() );

		return array_keys( $result );
	}
643011
public function getAllResultsAsArray(): array
    {
        $result = array();

        $entities = $this->getAllResults();

        // Convert search results to array
        foreach ($entities as $entity) {
            if (is_object($entity) && method_exists($entity, 'getValues')) {
                $result[] = $entity->getValues();
            } else {
                $result[] = (array)$entity;
            }
        }

        return $result;
    }
355090
public function getVariables()
    {
        if (!$this->getUseIndex()) {
            return array();
        }

        $staticVariables = $this->reflection->getStaticVariables();

        // When looping through the variables, we will only take the variables that are
        // specified in the use clause, and will not take any other static variables
        // that may be used by the Closures, allowing this to re-create its state.
        $usedVariables = array();

        foreach ($this->getUseClauseVariables() as $variable) {
            $variable = trim($variable, ' $&');

            $usedVariables[$variable] = $staticVariables[$variable];
        }

        return $usedVariables;
    }
1021711
public function toSearchableArray(): array
    {
        $entity = $this->getEntityObject();

        if (method_exists($entity, 'toSearchableArray')) {
            return $entity->toSearchableArray($this->toArray());
        }

        return [];
    }
510065
final protected function getContextChoices()
    {
        $contextChoices = [];
        /* @var ContextInterface $context */
        foreach ($this->contextManager->findAll() as $context) {
            $contextChoices[$context->getId()] = $context->getName();
        }

        return $contextChoices;
    }
1203722
public function entityAction()
    {
        $page = (int)$this->getEvent()->getRouteMatch()->getParam('page');
        $entityClass = $this->getEvent()->getRouteMatch()->getParam('entityClass');

        return array(
            'entityClass' => $entityClass,
            'page' => $page,
        );
    }
740691
public function findAll()
	{
		if ( $this->timeout == 0 ) {
			return parent::findAll();
		}

		return $this->searchContext->waitFor($this->timeout, array($this, 'parent::findAll'));
	}
1357463
protected function getUsedTraits()
    {
        $reflection = new \ReflectionClass($this);
        $properties = $reflection->getProperties();
        $traits = [];
        foreach($properties as $property) {
            $name = $property->getName();
            if(substr($name, 0, 3) == 'has') {
                $traits[] = substr($name, 3);
            }
        }
        return $traits;
    }
1013927
public function get_resources() {

        if (empty($this->resources)) {
            $this->resources = array();
            $this->resources[] = new \ltiservice_memberships\local\resources\contextmemberships($this);
            $this->resources[] = new \ltiservice_memberships\local\resources\linkmemberships($this);
        }

        return $this->resources;

    }
1139916
public function getFieldsUsed(): array
    {
        $fields = [];

        /** @var Field $node */
        foreach ($this->getNodesOfType(Field::NODE_TYPE) as $node) {
            $fields[$node->getName()] = true;
        }

        return array_keys($fields);
    }
333762
public function getContextsNumberOfIssues()
	{
		$list = [];

		foreach ($this->getChildren() as $child)
		{
			if ($child instanceof FunctionContext)
			{
				$list[] = [
					'name'      => $child->getName(),
					'startLine' => $child->startLine,
					'issues'    => $child->getIssuesCount()
				];
			}
			else
			{
				// this might be a class, look for methods
				foreach ($child->getChildren() as $method)
				{
					if ($method instanceof MethodContext)
					{
						$list[] = [
							'name'      => $child->getName().'::'.$method->getName(),
							'startLine' => $method->startLine,
							'issues'    => $method->getIssuesCount()
						];
					}
				}
			}
		}

		return $list;
	}
1137131
public function getBusinessEntityExtends()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $aExtends = [];

        foreach ($this->_aBusinessEntityExtends as $sExtend) {
            $aExtends[$sExtend] = $myConfig->getConfigParam($sExtend);
        }

        return $aExtends;
    }
146027
private function getContext(): array
    {
        $context = [$this->name];
        if ($this instanceof AliasInterface) {
            $context = array_unique(array_merge($context, $this->getAlias()));
        }

        return $context;
    }
664107
protected function getUsedClasses()
    {
        $uses = array();
        if ($orm = $this->getOrmUse()) {
            $uses[] = $orm;
        }
        if (count($this->getTableM2MRelations()) || count($this->getAllLocalForeignKeys())) {
            $uses[] = $this->getCollectionClass();
        }

        return $uses;
    }
1049971
public function getAllEntitiesToArray()
    {
        $entities = $this->getAll();
        $array = [];
        foreach ($entities as $entity) {
            $depth = isset($entity->depth) ? str_repeat('— ', $entity->depth) : '';
            $title = $entity->title ?? $entity->name;
            $array[$entity->id] = $depth . $title;
        }
        return $array;
    }
721171
public function getContext()
    {

        if (is_null($this->context) && !is_null($this->contextId)) {
            $this->context = Context::fromRecordId($this->contextId, $this->getDataConnector());
        }

        return $this->context;

    }
1278821
public function getContext()
    {
        $context = [
            'log_cmd_insert'    => [$this, 'onInsert'],
            'log_cmd_delete'    => [$this, 'onDelete'],
            'log_cmd_update'    => [$this, 'onUpdate'],
            'log_insert'        => [$this, 'onInsert'],
            'log_delete'        => [$this, 'onDelete'],
            'log_update'        => [$this, 'onUpdate'],
            'log_batchinsert'   => [$this, 'onBatchInsert'],
            'log_write_batch'   => [$this, 'onBatchInsert'],
            'log_query'         => [$this, 'onQuery']
        ];
        return $context;
    }