Get a Form Element by its identifier

If identifier does not exist, returns NULL.

@param string $elementIdentifier
@return FormElementInterface The element with the given $elementIdentifier or NULL if none found
@api
173553
public function getElementByIdentifier($elementIdentifier)
    {
        return isset($this->elementsByIdentifier[$elementIdentifier]) ? $this->elementsByIdentifier[$elementIdentifier] : null;
    }
857933
protected function initFormElement(ElementInterface $element)
    {
        $this->name($element->getName())->type('text');

        $this->getElement()->addAttributes($element->getAttributes());

        $type = $element->getAttribute('type');

        if (null !== $type) {
            $this->type(strtolower($type));
        }

        $this->value($element->getValue());

        return $this;
    }
670285
public function loadIdentifier($identifier)
    {
        $result = false;

        $identifier = AnService::getIdentifier($identifier);

        //Get the path
        $path = $identifier->filepath;

        if ($path !== false) {
            $result = self::loadFile($path);
        }

        return $result;
    }
148660
public function get(string $entryIdentifier)
    {
        if ($entryIdentifier !== basename($entryIdentifier)) {
            throw new \InvalidArgumentException('The specified entry identifier must not contain a path segment.', 1334756877);
        }

        $pathAndFilename = $this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension;

        if (!file_exists($pathAndFilename)) {
            return false;
        }

        return $this->readCacheFile($pathAndFilename);
    }
916743
public function getEntityByIdentifier($identifier)
    {
        $found_entities = $this->filter(
            function (EntityInterface $entity) use ($identifier) {
                return $entity->getIdentifier() === $identifier;
            }
        );

        return $found_entities->getFirst();
    }
230200
public function getNodeByIdentifier($identifier)
    {
        $node = $this->firstLevelNodeCache->getByIdentifier($identifier);
        if ($node !== false) {
            return $node;
        }
        $nodeData = $this->nodeDataRepository->findOneByIdentifier($identifier, $this->getWorkspace(), $this->dimensions, $this->removedContentShown);
        if ($nodeData !== null) {
            $node = $this->nodeFactory->createFromNodeData($nodeData, $this);
        } else {
            $node = null;
        }
        $this->firstLevelNodeCache->setByIdentifier($identifier, $node);
        return $node;
    }
1073309
public function addElementDefaultValue($elementIdentifier, $defaultValue)
    {
        $this->elementDefaultValues = Arrays::setValueByPath($this->elementDefaultValues, $elementIdentifier, $defaultValue);
    }
67456
public function get(string $entryIdentifier)
    {
        $success = false;
        $value = apcu_fetch($this->identifierPrefix . 'entry_' . $entryIdentifier, $success);
        return ($success ? $value : $success);
    }
371334
public function getPortableElementByIdentifier($type, $identifier, $version=null)
    {
        $model = $this->getPortableModelRegistry()->getModel($type);
        $registry = $model->getRegistry();

        if($registry->has($identifier, $version)){
            return $registry->fetch($identifier, $version);
        }
        return null;
    }
178093
public static function get($identifier, $default = null)
    {
        $value = self::getInternal($identifier);

        if (is_null($value)) {
            return $default;
        }

        return $value;
    }
679691
protected function acquireToken($tokenIdentifier)
    {
        $filtered = array_filter($this->tokens, function ($val) use ($tokenIdentifier) {
            return $val['token'] === $tokenIdentifier;
        });
        $keys = array_keys($filtered);
        $this->tokens[$keys[0]]['available'] = false;
    }
1068818
protected function getCredentialsFor( $roleIdentifier )
    {
        $roleService = $this->getRepository()->getRoleService();

        // First try to load role, throws exception if not found.
        $role = $this->getRepository()->sudo(
            function() use ( $roleService, $roleIdentifier )
            {
                // make sure role name starts with uppercase as this is what default setup provides
                if ($roleIdentifier !== ucfirst($roleIdentifier)) {
                    @trigger_error(
                        "'{$roleIdentifier}' role name should start with uppercase letter",
                        E_USER_DEPRECATED
                    );
                }

                return $roleService->loadRoleByIdentifier(ucfirst($roleIdentifier));
            }
        );

        // create a new user, uses 'User' trait
        $username = $this->findNonExistingUserName();
        $password = $this->getUserManager()->getDefaultPassword();
        $email = "${username}@ez.no";
        $user = $this->getUserManager()->ensureUserExists( $username, $email, $password );

        // Assign role to created user (without limitation)
        $this->getRepository()->sudo(
            function() use ( $roleService, $role, $user )
            {
                return $roleService->assignRoleToUser(
                    $role,
                    $user
                );
            }
        );

        return array(
            'login'     => $username,
            'password'  => $password,
        );
    }
888365
public function findByIdentifier($identifier, $pageTsPids = array())
    {
        $backendLayouts = $this->findAll($pageTsPids);
        if (isset($backendLayouts[$identifier])) {
            return $backendLayouts[$identifier];
        } else {
            return null;
        }
    }
1040917
public function getElement(Parser $parser, ElementInterface $parent = null)
    {
        $parser->getReader()->open($this->src);
        $parsed = $parser->getReader()->parse();

        return $parser->parseElements($parsed['value'], $parent);
    }
795207
public function buildForm($identifier = null)
	{
		$this->setFormMapper(new FormMapper);
		$this->configureForm($this->getFormMapper());

		$this->setFormBuilder(new FormBuilder($this->getFormMapper()));
		$this->getFormBuilder()
			->setModel($this->getModel())
			->setIdentifier($identifier)
			->setContext($identifier === null ? FormBuilder::CONTEXT_CREATE : FormBuilder::CONTEXT_EDIT)
			->build();

		return $this;
	}
1045971
public function getParameter($identifier)
    {
        return isset($this->parameters[$identifier]) ? $this->parameters[$identifier] : null;
    }
273623
protected function getOneByIdentifier($identifier)
	{
		return $this->aggregate[IdentifierServiceProvider::getProviderKey()]->get([['field' => 'id', 'value' =>  $identifier->getEntityKey(), 'operator' => '=', 'or' => false]]);
	}