2017-08-10
@used-by p()
@throws DFE
@return mixed|null
489784
private function _p() {
		$c = $this->_c; /** @var C $c */
		$c->setHeaders($this->headers());
		$c->setUri($this->url());
		try {
			$res = $c->request(); /** @var \Zend_Http_Response $res */
			if (!($resBody = $res->getBody()) && $res->isError()) { /** @var string $resBody */
				throw new eHTTP($res);
			}
			else {
				/** @var mixed|null $result */
				// 2017-08-08
				// «No Content»
				// «The server has successfully fulfilled the request
				// and that there is no additional content to send in the response payload body»
				// https://httpstatuses.com/204
				if (!$resBody && 204 === $res->getStatus()) {
					$result = null;
				}
				else {
					$result = $this->_filtersResBV->filter($resBody);
					if ($validatorC = $this->responseValidatorC() /** @var string $validatorC */) {
						$validator = new $validatorC($result); /** @var Validator $validator */
						if (!$validator->valid()) {
							throw $validator;
						}
					}
					$result = $this->_filtersResAV->filter($result);
				}
			}
		}
		catch (\Exception $e) {
			/** @var string $long */ /** @var string $short */
			list($long, $short) = $e instanceof E ? [$e->long(), $e->short()] : [null, df_ets($e)];
			$req = df_zf_http_last_req($c); /** @var string $req */
			$title = df_api_name($m = df_module_name($this)); /** @var string $m */ /** @var string $title */
			$ex = df_error_create("A `{$this->_path}` {$title} API request has failed: «{$short}».\n" . (
				$long === $short ? "Request:\n{$req}" : df_cc_kv([
					'The full error description' => $long, 'Request' => $req
				])
			)); /** @var DFE $ex */
			df_log_l($m, $ex);
			df_sentry($m, $short, ['extra' => ['Request' => $req, 'Response' => $long]]);
			throw $ex;
		}
		return $result;
	}
1089261
public function nextElementSibling()
    {
        $p = $this->_next();
        return $p ? new self($this->doc, $p) : null;
    }
573776
public function getILN ()
    {
        $ilnField = $this->getFirstMatchingField('101@/00');
        if ($ilnField) {
            $ilnSubfield = $ilnField->getNthSubfield('a', 0);
            if ($ilnSubfield) {
                return $ilnSubfield->getValue();
            }
        }
        return null;
    }
742791
function dob() {return dfc($this, function() {
		/** @var \DateTime|null $result */
		$result = $this->_dob();
		if (!$result && df_is_customer_attribute_required('dob')) {
			$result = new \DateTime;
			$result->setDate(1900, 1, 1);
		}
		return $result;
	});}
271423
public function getValue()
    {
        if ( ! isset($this->input[$this->inputName])) {
            return null;
        }

        return $this->input[$this->inputName];
    }
875818
public function first()
    {
        $oldLimit = $this->limit;
        $this->limit = 1;
        $rows = $this->get();
        $this->limit = $oldLimit;
        return isset($rows[0]) ? $rows[0] : null;
    }
1317620
public function first()
    {
        foreach ($this->dataQuery->firstRow()->execute() as $row) {
            return $this->createDataObject($row);
        }
        return null;
    }
564484
public function getPhpDefaultValue()
    {
        if (null === $this->defaultValue) {
            return null;
        }

        if ($this->defaultValue->isExpression()) {
            throw new EngineException('Cannot get PHP version of default value for default value EXPRESSION.');
        }

        if (in_array($this->mappingType, [ PropelTypes::BOOLEAN, PropelTypes::BOOLEAN_EMU ])) {
            return $this->booleanValue($this->defaultValue->getValue());
        }

        if (PropelTypes::PHP_ARRAY === $this->mappingType) {
            return $this->getDefaultValueForArray($this->defaultValue->getValue());
        }
        if (PropelTypes::SET === $this->mappingType) {
            return $this->getDefaultValueForSet($this->defaultValue->getValue());
        }

        return $this->defaultValue->getValue();
    }
432598
public function getPrimaryKeyValue()
    {
        //
        $key = static::getPrimaryKey();

        //
        return $key
            && isset($this->{$key})
            ? $this->{$key}
            : null;
    }
640768
public function getFieldValue() {

		switch( $this->type ) {

			case self::TYPE_TEXT:
			case self::TYPE_TEXTAREA:
			case self::TYPE_RADIO:
			case self::TYPE_RADIO_GROUP:
			case self::TYPE_SELECT:
			case self::TYPE_RATING:
			case self::TYPE_ICON:
			case self::TYPE_CHECKBOX_GROUP: {

				return $this->value;
			}
			case self::TYPE_PASSWORD: {

				return null;
			}
			case self::TYPE_CHECKBOX:
			case self::TYPE_TOGGLE: {

				return Yii::$app->formatter->asBoolean( $this->value );
			}
		}
	}
1184642
protected function getData() {
        $data = Input::all();
        if (is_array($data)) {
            return $this->excludeKeys($data);
        } else {
            return null;
        }
    }
1340498
public function current()
    {
        if (!is_array($this->val)) {
            return null;
        }
        if ($this->assocArray) {
            $keys = array_keys($this->val);
            return $this->val[$keys[$this->position]];
        }

        return $this->val[$this->position];
    }
936429
public function getOne()
    {
        $res = $this->getRow();
        $this->rewind();
        $this->stmt = null;

        return $res[0];
    }
655485
public function getCreatedBy()
    {
        $createdByAttribute = $this->createdByAttribute;
        return (!is_string($createdByAttribute) || empty($createdByAttribute)) ? null : $this->$createdByAttribute->getData();
    }
876755
protected function setFormDataAfterCheckout()
    {
        if (empty($this->data_cart)) {
            return null;
        }

        $this->data_form['cart'] = $this->data_cart;

        $this->setFormDataAddressCheckout();

        if (empty($this->data_form['addresses'])) {
            $this->show_shipping_address_form = true;
        }

        $this->data_form['default_payment_method'] = false;
        $this->data_form['default_shipping_method'] = false;
        $this->data_form['same_payment_address'] = $this->same_payment_address;
        $this->data_form['get_payment_methods'] = $this->isPosted('get_payment_methods');
        $this->data_form['get_shipping_methods'] = $this->isPosted('get_shipping_methods');
        $this->data_form['show_login_form'] = $this->show_login_form;
        $this->data_form['show_payment_address_form'] = $this->show_payment_address_form;
        $this->data_form['show_shipping_address_form'] = $this->show_shipping_address_form;
        $this->data_form['show_payment_methods'] = !$this->data_form['has_dynamic_payment_methods'];
        $this->data_form['show_shipping_methods'] = !$this->data_form['has_dynamic_shipping_methods'];

        $submitted = array('order' => $this->getSubmitted());

        $this->data_form['context_templates'] = array(
            'payment' => $this->getPaymentMethodTemplate('context', $submitted['order'], $this->payment),
            'shipping' => $this->getShippingMethodTemplate('context', $submitted['order'], $this->shipping),
        );

        $this->data_form = gplcart_array_merge($this->data_form, $submitted);

        $this->setFormDataRequestServicesCheckout('payment');
        $this->setFormDataRequestServicesCheckout('shipping');
        $this->setFormDataCalculatedCheckout();
        $this->setFormDataPanesCheckout();
    }
310240
function dob() {return dfc($this, function() {
		/** @var \DateTime|null $r */
		if (!($r = $this->_dob()) && df_is_customer_attribute_required('dob')) {
			$r = new \DateTime;
			$r->setDate(1900, 1, 1);
		}
		return $r;
	});}
1254131
protected function scanTableRow()
    {
        if (!$this->allowMultilineArguments) {
            return null;
        }

        $line = $this->getTrimmedLine();
        if (!isset($line[0]) || '|' !== $line[0] || '|' !== substr($line, -1)) {
            return null;
        }

        $token = $this->takeToken('TableRow');
        $line = mb_substr($line, 1, mb_strlen($line, 'utf8') - 2, 'utf8');
        $columns = array_map(function ($column) {
            return trim(str_replace('\\|', '|', $column));
        }, preg_split('/(?<!\\\)\|/u', $line));
        $token['columns'] = $columns;

        $this->consumeLine();

        return $token;
    }