It fetches a value.
@param int $inputType INPUT_POST|INPUT_GET|INPUT_REQUEST
@param string $field
@param null|string $msg
@param bool $isMissing
@return mixed
324794
public function fetch($inputType,$field,$msg=null,&$isMissing=false) {
		$r=$this->getField($field,$inputType,$msg,$isMissing);
		return $r;
	}
144891
protected function getValue(& $field, & $options, array $parameters)
    {
        static
            $camelize = [
                'pending_file_attachments' => true,
                'date_format'              => true,
                'send_welcome_email'       => true,
                'receive_daily_reports'    => true,
                'welcome_email_message'    => true,
                'auto_give_project_access' => true,
                'open_id'                  => true,
                'user_language'            => true,
                'pending_file_ref'         => true,
                'new_company'              => true
            ],
            $yes_no_boolean = [
                'welcome_email_message',
                'send_welcome_email',
                'receive_daily_reports',
                'notes',
                'auto_give_project_access'
            ],
            $preserve = [
                'address_one' => true,
                'address_two' => true
            ];
        $value = isset($parameters[$field]) ? $parameters[$field] : null;
        if (!is_array($options)) {
            $options = ['required'=>$options, 'attributes'=> []];
        }
        $isNull =  null === $value;
        //verficando campos requeridos
        if ($this->method == 'POST' && $options['required']) {
            if ($isNull) {
                throw new Exception('Required field ' . $field);
            }
        }
        //verficando campos que debe cumplir ciertos valores
        if (!$isNull && isset($options['validate']) &&
                        !in_array($value, $options['validate'])) {
            throw new Exception('Invalid value for field ' .
                                                            $field);
        }
        // @todo Ojo la gente de team work no mainten constante el formato name-other
        if (isset($camelize[$field])) {
            if ($field === 'open_id') {
                $field = 'openID';
            } else {
                $field = Str::camel($field);
            }
        } elseif (!isset($preserve[$field])) {
            if ($field === 'company_id') {
                if ($this->action === 'projects') {
                    $field = Str::camel($field);
                } elseif ($this->action == 'people') {
                    $field = Str::dash($field);
                }
            } else {
                $field = Str::dash($field);
            }
        }
        return $value;
    }
1124856
protected function decodeMessageBody(MessageInterface $msg)
    {
        // do we accept this type? (nb: this is an optional property)
        $type = $msg->getContentType();
        if ($type == '' && $this->assumedContentType != '') {
            $type = $this->assumedContentType;
        }
        if ($type == '' || !in_array($type, $this->acceptedContentTypes)) {
            throw new \RuntimeException("Can not decode message with content type: '$type'");
        }

        // then decode it
        switch ($type) {
            case 'application/json':
                $data = json_decode($msg->getBody(), true);
                if ($error = json_last_error()) {
                    throw new \UnexpectedValueException("Error decoding json payload: " . $error);
                }
                return $data;
            case 'application/x-httpd-php-source':
                /// @todo should we wrap this in try/catch, ob_start and set_error_handler, or just make sure it is never used?
                return eval ('return ' . $msg->body . ';');
            case 'vnd.php.serialized':
                return unserialize($msg->body);
            case 'text/plain':
            case 'application/octet-stream':
                return $msg->body;
            default:
                throw new \UnexpectedValueException("Serialization format unsupported: " . $type);
        }
    }
741952
public function input($fieldName, $options = array()) {
		$this->_inputType = null;
		$this->_fieldName = $fieldName;
		$options = $this->_initInputOptions($options);

		return parent::input($fieldName, $options);
	}
1307537
public function inputType()
    {
        if ($this->inputType === null) {
            $this->inputType = $this->resolveInputType();
        }

        return $this->inputType;
    }
281177
@Override
    public InputHandler getInputHandler(ProtocolType type, SIBUuid8 sourceMEUuid, JsMessage msg)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "getInputHandler",
                        new Object[] { type, sourceMEUuid, msg });

        InputHandler msgHandler = null;

        if (type == ProtocolType.UNICASTINPUT)
        {
            msgHandler = getInputHandler();
        }
        else if (type == ProtocolType.PUBSUBINPUT)
        {
            msgHandler = getInputHandler();
        }
        else if (type == ProtocolType.ANYCASTINPUT)
        {

            // For durable, AIHs are referenced by pseudo destination ID so check for that first
            SIBUuid12 destID = msg.getGuaranteedTargetDestinationDefinitionUUID();
            SIBUuid12 gatheringTargetDestUuid = msg.getGuaranteedGatheringTargetUUID();

            msgHandler = _protoRealization.
                            getRemoteSupport().
                            getAnycastInputHandlerByPseudoDestId(destID);

            // Otherwise, use the uuid of the sourceCellule ME to find the RCD to deliver the message. We assume that this
            // uuid corresponds to that used to choose the RCD initially, and that was used by the associated
            // AIH as the uuid of the DME to which it sent the request for the message.
            if (msgHandler == null)
                msgHandler = getAnycastInputHandler(sourceMEUuid, gatheringTargetDestUuid, true);
        }
        //else
        //{
        //unsupported protocol type
        //return null
        //}

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getInputHandler", msgHandler);

        return msgHandler;
    }
578893
public function readValue($token = null, $expectedType = null)
    {
        if ($token === null) {
            $token = $this->tokenizer->getNextToken();
        }

        if ($token === false) {
            if ($expectedType !== null) {
                throw new Type\PdfTypeException('Got unexpected token type.', Type\PdfTypeException::INVALID_DATA_TYPE);
            }
            return false;
        }

        switch ($token) {
            case '(':
                $this->ensureExpectedType($token, $expectedType);
                return PdfString::parse($this->streamReader);

            case '<':
                if ($this->streamReader->getByte() === '<') {
                    $this->ensureExpectedType('<<', $expectedType);
                    $this->streamReader->addOffset(1);
                    return PdfDictionary::parse($this->tokenizer, $this->streamReader, $this);
                }

                $this->ensureExpectedType($token, $expectedType);
                return PdfHexString::parse($this->streamReader);

            case '/':
                $this->ensureExpectedType($token, $expectedType);
                return PdfName::parse($this->tokenizer, $this->streamReader);

            case '[':
                $this->ensureExpectedType($token, $expectedType);
                return PdfArray::parse($this->tokenizer, $this);

            default:
                if (\is_numeric($token)) {
                    if (($token2 = $this->tokenizer->getNextToken()) !== false) {
                        if (\is_numeric($token2)) {
                            if (($token3 = $this->tokenizer->getNextToken()) !== false) {
                                switch ($token3) {
                                    case 'obj':
                                        if ($expectedType !== null && $expectedType !== PdfIndirectObject::class) {
                                            throw new Type\PdfTypeException(
                                                'Got unexpected token type.', Type\PdfTypeException::INVALID_DATA_TYPE
                                            );
                                        }

                                        return PdfIndirectObject::parse(
                                            $token,
                                            $token2,
                                            $this,
                                            $this->tokenizer,
                                            $this->streamReader
                                        );
                                    case 'R':
                                        if ($expectedType !== null &&
                                            $expectedType !== PdfIndirectObjectReference::class
                                        ) {
                                            throw new Type\PdfTypeException(
                                                'Got unexpected token type.', Type\PdfTypeException::INVALID_DATA_TYPE
                                            );
                                        }

                                        return PdfIndirectObjectReference::create($token, $token2);
                                }

                                $this->tokenizer->pushStack($token3);
                            }
                        }

                        $this->tokenizer->pushStack($token2);
                    }

                    if ($expectedType !== null && $expectedType !== PdfNumeric::class) {
                        throw new Type\PdfTypeException(
                            'Got unexpected token type.', Type\PdfTypeException::INVALID_DATA_TYPE
                        );
                    }
                    return PdfNumeric::create($token);
                }

                if ($token === 'true' || $token === 'false') {
                    $this->ensureExpectedType($token, $expectedType);
                    return PdfBoolean::create($token === 'true');
                }

                if ($token === 'null') {
                    $this->ensureExpectedType($token, $expectedType);
                    return new PdfNull();
                }

                if ($expectedType !== null && $expectedType !== PdfToken::class) {
                    throw new Type\PdfTypeException(
                        'Got unexpected token type.', Type\PdfTypeException::INVALID_DATA_TYPE
                    );
                }

                $v = new PdfToken();
                $v->value = $token;

                return $v;
        }
    }
857782
public static function request($key = null, $type = 'string', $defaultValue = '')
    {
        if (!$key) {
            return array_merge($_GET, $_POST);
        }
        return self::typeConvert(isset($_REQUEST[$key]) ? $_REQUEST[$key] : $defaultValue, $type);
    }
823864
public static function input($field, $title, $value = '', $type = Input::TYPE_TEXT)
    {
        $input = new Input($field, $title, (string)$value);
        $input->type($type);
        return $input;
    }
507263
public function deserializeFieldType(GenericDeserializationVisitor $visitor, $contentAttributeValue, array $type, Context $context)
    {
        $facade = $visitor->getCurrentObject();
        if ($facade instanceof ContentAttributeFacade && null !== $facade->type) {
            if (isset($this->fieldTypes[$facade->type]) &&
                isset($this->fieldTypes[$facade->type]['deserialize_type'])
            ) {
                if ($this->fieldTypes[$facade->type]['deserialize_type'] == 'array' && is_scalar($contentAttributeValue)) {
                    $contentAttributeValue = array($contentAttributeValue);
                }

                return $visitor->getNavigator()->accept($contentAttributeValue, array('name' => $this->fieldTypes[$facade->type]['deserialize_type'], 'params' => array()), $context);
            }
        }

        return null;
    }
454215
public function getTypeId($type, $createIfMissing = true)
    {
        if (null === $this->types) {
            $this->loadCache();
        }

        if (false === ($key = array_search($type, $this->types, true))) {

            if (!$createIfMissing) {
                return null;
            }

            try {
                $this
                    ->backend
                    ->getConnection()
                    ->insert('apb_msg_type')
                    ->fields(array('type' => $type))
                    ->execute()
                ;

            } catch (\PDOException $e) {
                // Another thread went doing this at the same time and created
                // the same type, ignore error and continue
            }

            $this->loadCache();

            return array_search($type, $this->types, true);

        } else {
            return $key;
        }
    }
976020
public function validate($mInput, $oField)
    {
        $mInput = parent::validate($mInput, $oField);

        if (!is_numeric($mInput)) {
            throw new FieldTypeException('This field should be numeric.', 1);
        }

        return $mInput;
    }
282772
public function inputValue($field)
    {
        $element = $this->resolver->resolveForTyping($field);

        return in_array($element->getTagName(), ['input', 'textarea'])
                        ? $element->getAttribute('value')
                        : $element->getText();
    }
315413
public function getValueFromInput(InputInterface $input, $normalize = true)
    {
        $optionName = $this->getOptionName();
        if (!$input->hasOption($optionName)) {
            return null;
        }
        $value = $input->getOption($optionName);
        if ($this->isEmpty($value)) {
            return null;
        }
        if ($input->getParameterOption('--' . $optionName) === false && $value === $this->default) {
            return null;
        }

        return $normalize ? $this->normalize($value) : $value;
    }
13975
public function sendSMS( $mobile, $msg, $needstatus = 'false') {

		//创蓝接口参数
		$postArr = array (
				          'account' => $this->apiAccount,
				          'pswd' => $this->apiPassword,
				          'msg' => $msg,
				          'mobile' => $mobile,
				          'needstatus' => $needstatus
                     );

		$result = $this->curlPost( $this->apiSendUrl , $postArr);
		return $result;
	}
1168138
public function sendByType(int $typeId, string $msg, ?string $dest = null, bool $flush = false) : void
    {
        $msg = $this->composeMsg($msg, $dest);

        $subscriptions = $this->subscriptionTable->findAll()
            ->where('subscription.active', 1)
            ->where('user.active', 1)
            ->where('user:user_subscription_type.subscription_type_id', $typeId);

        foreach ($subscriptions as $row)
        {
            $this->sendNotification($row, $msg, false);
        }

        if ($flush)
        {
            $this->flush();
        }
    }
1338153
public static function setTypeMsg($type, $msg=null)
    {
        if (is_array($type)) {
            self::$typeMsg=array_merge(self::$typeMsg, $type);
        } else {
            self::$typeMsg[$type]=$msg;
        }
    }