2015-12-07
@used-by \Df\Framework\Form\Element\ArrayT::onFormInitialized()
@param string|null $name [optional]
@return string|null
@throws DFE
557847
final protected function v($name = null) {return dfak($this, function() {
		$result = dfa($this->_data, 'value', []);
		/**
		 * 2016-06-29
		 * Что интересно, при смене области действия настроек с глобальной на другую (сайт или магазин)
		 * поле «value» может почему-то содержать не массив,
		 * а строку JSON, соответствующую запакованному в JSON массиву:
		 * https://code.dmitry-fedyuk.com/m2e/currency-format/issues/1
		 * Заметил это только для модуля «Price Format».
		 */
		return is_array($result) ? $result : df_json_decode($result);
	}, $name);}
820163
private function getValue($form, $name)
    {
        if (is_array($form)) {
            return isset($form[$name]) ? $form[$name] : null;
        } elseif (is_object($form)) {
            $method = 'get' . $name;
            if (method_exists($form, $method)) {
                return $form->$method();
            } else {
                return isset($form->$name) ? $form->$name : null;
            }
        }
    }
69247
public function getElement(string $name): Element
    {
        if ($this->page_object_factory === null) {
            throw new RuntimeException('[W406] To create elements you need to pass a factory with setPageObjectFactory()');
        }

        return $this->page_object_factory->createElement($name);
    }
347577
public function findFormControlByName(string $name): ?Control
  {
    foreach ($this->controls as $control)
    {
      if ($control->name===$name) return $control;

      if ($control instanceof ComplexControl)
      {
        $tmp = $control->findFormControlByName($name);
        if ($tmp) return $tmp;
      }
    }

    return null;
  }
1116079
public static function getFormatTemplate($name) {
        $file = sprintf(
            '%s/Model/template/format/%s.html',
            __DIR__,
            $name
        );

        if (!file_exists($file)) {
            return null;
        }

        if (!isset(self::$templates[$name])) {
            self::$templates[$name] = file_get_contents($file);
        }

        return self::$templates[$name];
    }
371868
public function createBatchActionForm($name)
    {
        /** @var AbstractAdmin $admin */
        $admin = $this->getAdmin();

        $container = $admin->getContainer();

        return $container->get('form.factory')->createNamedBuilder($name, 'form', [], [
            'label_format' => 'form.label_%name%',
            'translation_domain' => $admin->getTranslationDomain(),
        ]);
    }
853610
protected function formField ($name, $def = null)
  {
    return Http::field ($this->request, $name, $def);
  }
758839
protected function getFormValue($name)
    {
        $this->setFormValues();
        return isset($this->formValues[$name]) ? $this->formValues[$name] : '';
    }
980234
public function isElementInTable(string $name): bool
    {
        return $this->context->getElementByText($name, $this->fields['listElement']) !== null;
    }
704872
public function getDirective($name)
    {
        if (!$this->initialized) {
            $this->initialize();
        }

        return isset($this->directives[$name]) ? $this->directives[$name] : null;
    }
377882
public function getElement($name)
    {
        $elements = $this->getElements();

        return isset($elements[$name]) ? $elements[$name] : null;
    }
1216450
public function getBeforeForwardInfo($name = null)
    {
        if (is_null($name)) {
            return $this->_beforeForwardInfo;
        } elseif (isset($this->_beforeForwardInfo[$name])) {
            return $this->_beforeForwardInfo[$name];
        }

        return null;
    }
909218
function attribute( $name )
    {
        if ( isset( $this->AttributeVariableMap[$name] ) )
        {
            $memberVariable = $this->AttributeVariableMap[$name];
            return $this->$memberVariable;
        }
        else
        {
            eZDebug::writeError( "Attribute '$name' does not exist", __METHOD__ );
            return null;
        }
    }
947720
public static function fromQName( $name )
	{
		if ( $name instanceof QName )
		{
			$name = "{$name->prefix}:{$name->localName}";
		}
		if ( ! is_string( $name ) )
		{
			throw new \InvalidArgumentException( "$name must be string or a QName instanxe" );
		}

		$types = SchemaTypes::getInstance();
		$attribute = $types->getElement( $name );

		if ( ! $attribute )
		{
			return null;
		}

		$result = new DOMSchemaAttribute();
		error_log( __CLASS__ . " need to populate the DOMSchemaAttribute instance" );
		return $result;
	}
526070
public function __isset($name)
    {
        try {
            return $this->$name !== null;
        } catch (MemberAccessException $e) {
            return false;
        } catch (LeanMapperException $e) {
            if ($this->isDetached() and $e->getCode() === Result::ERROR_MISSING_COLUMN) {
                return false;
            }
            throw $e;
        }
    }
1083423
protected function resolveUnknown(/*# string */ $name)
    {
        // warn if reference unknown
        $this->throwError(
            Message::get(Message::CONFIG_REFERENCE_UNKNOWN, $name),
            Message::CONFIG_REFERENCE_UNKNOWN
        );

        return null;
    }
557712
public function getValue(string $name): ?string
    {
        if (isset($this->data[$name])) {
            return $this->data[$name]->value;
        }
        return null;
    }