给对象设置属性值
@param $object
@param array $options
976769
public static function configure($object, array $options)
    {
        foreach ($options as $property => $value) {
            $object->$property = $value;
        }
    }
529849
public function uploadPart($bucket, $object, $uploadId, $options = null)
    {
        $this->precheckCommon($bucket, $object, $options);
        $this->precheckParam($options, self::OSS_FILE_UPLOAD, __FUNCTION__);
        $this->precheckParam($options, self::OSS_PART_NUM, __FUNCTION__);

        $options[self::OSS_METHOD] = self::OSS_HTTP_PUT;
        $options[self::OSS_BUCKET] = $bucket;
        $options[self::OSS_OBJECT] = $object;
        $options[self::OSS_UPLOAD_ID] = $uploadId;

        if (isset($options[self::OSS_LENGTH])) {
            $options[self::OSS_CONTENT_LENGTH] = $options[self::OSS_LENGTH];
        }
        $response = $this->auth($options);
        $result = new UploadPartResult($response);
        return $result->getData();
    }
607899
protected function init(array $options = array())
    {
        foreach ($options as $key => $value) {
            if (property_exists($this, $key)) {
                $this->{$key} = $value;
            }
        }
    }
524987
protected function prepareParams($object, &$params)
    {
        $properties = get_object_vars($object);
        foreach ($properties as $p => $v) {
            if (is_scalar($v)) {
                $params[substr($p, 1)] = $v;
            }
        }
    }
133748
private function deserializeObjects(Item $question, array $objects = [], array $options = [])
    {
        $objectEntities = $question->getObjects()->toArray();
        $question->emptyObjects();

        foreach ($objects as $index => $objectData) {
            $existingObject = null;

            // Searches for an existing object entity.
            foreach ($objectEntities as $entityIndex => $entityObject) {
                /** @var ItemObject $entityObject */
                if ($entityObject->getUuid() === $objectData['id']) {
                    $existingObject = $entityObject;
                    unset($objectEntities[$entityIndex]);
                    break;
                }
            }
            $itemObject = $this->itemObjectSerializer->deserialize($objectData, $existingObject, $options);
            $itemObject->setOrder($index);
            $question->addObject($itemObject);
        }

        // Remaining objects are no longer in the Item
        if (0 < count($objectEntities)) {
            foreach ($objectEntities as $objectToRemove) {
                $this->om->remove($objectToRemove);
            }
        }
    }
788410
static public function setObjectProperties($object, array $config = [])
    {
        foreach (static::createSetterMethods($config) as $method => $value) {
            if (method_exists($object, $method)) {
                call_user_func_array([$object, $method], [$value]);
            }
        }
    }
869216
public static function set($key, $value, $options = []) {
		array_key_set(self::$settings, $key, $value, $options);
	}
1195497
public function listParts($bucket, $object, $uploadId, $options = null)
    {
        $this->precheckCommon($bucket, $object, $options);
        $options[self::OSS_METHOD] = self::OSS_HTTP_GET;
        $options[self::OSS_BUCKET] = $bucket;
        $options[self::OSS_OBJECT] = $object;
        $options[self::OSS_UPLOAD_ID] = $uploadId;
        $options[self::OSS_QUERY_STRING] = array();
        foreach (array('max-parts', 'part-number-marker') as $param) {
            if (isset($options[$param])) {
                $options[self::OSS_QUERY_STRING][$param] = $options[$param];
                unset($options[$param]);
            }
        }
        $response = $this->auth($options);
        $result = new ListPartsResult($response);
        return $result->getData();
    }
649377
public function save($object, array $options = []) {
		$returnobject = [];
		$returnobject['result'] = false;
		$returnobject['msg'] = '';

		if (empty($object)) {
			return $returnobject;
		}

		//Create filename based on timestamp and random number (to prevent collisions)
		$object['filename'] = $this->generateFilename($object);

		if ($this->saveFile($object, $options['location'])) {
			$msg = __d('feedback', 'Thank you. Your feedback was saved.');

			if (!empty($options['returnlink'])) {
				$msg .= ' ';
				$msg .= __d('feedback', 'View your feedback on: ');

				$url = Router::url(['plugin' => 'Feedback', 'controller' => 'Feedback', 'action' => 'index'], true);

				$msg .= '<a target="_blank" href="' . $url . '">' . $url . '</a>';
			}

			$returnobject['result'] = true;
			$returnobject['msg'] = $msg;
		}

		return $returnobject;
	}
838177
public function deserialize($data, $object, $options = [])
    {
        // search for the correct serializer
        if ($meta = $this->om->getClassMetaData(get_class($object))) {
            $class = $meta->name;
        }

        $serializer = $this->get($class);

        if (method_exists($serializer, 'deserialize')) {
            $serializer->deserialize($data, $object, $options);
        }

        return $object;
    }
560283
private function authPrecheckObjectEncoding(&$options)
    {
        $tmp_object = $options[self::OSS_OBJECT];
        try {
            if (OssUtil::isGb2312($options[self::OSS_OBJECT])) {
                $options[self::OSS_OBJECT] = iconv('GB2312', "UTF-8//IGNORE", $options[self::OSS_OBJECT]);
            } elseif (OssUtil::checkChar($options[self::OSS_OBJECT], true)) {
                $options[self::OSS_OBJECT] = iconv('GBK', "UTF-8//IGNORE", $options[self::OSS_OBJECT]);
            }
        } catch (\Exception $e) {
            try {
                $tmp_object = iconv(mb_detect_encoding($tmp_object), "UTF-8", $tmp_object);
            } catch (\Exception $e) {
            }
        }
        $options[self::OSS_OBJECT] = $tmp_object;
    }
360063
public function warn($Object, $Label = null, $Options = array())
    {
        return $this->fb($Object, $Label, FirePHP::WARN, $Options);
    }
597647
public function passwordField($objectName, $property, array $options = [])
    {
        if (!array_key_exists('value', $options)) {
            $options['value'] = '';
        }
        return $this->formField('password', $objectName, $property, $options);
    }
589027
function setOptions(object, options) {
      options = object.options = _.assign({}, cloneDeep(object.constructor.options), cloneDeep(options));

      _.forOwn(options, function(value, key) {
        if (value != null) {
          // Add event listeners.
          if (/^on[A-Z]/.test(key)) {
            _.each(key.split(' '), function(key) {
              object.on(key.slice(2).toLowerCase(), value);
            });
          } else if (!_.has(object, key)) {
            object[key] = cloneDeep(value);
          }
        }
      });
    }
482158
public function error($Object, $Label = null, $Options = array())
    {
        return $this->fb($Object, $Label, FirePHP::ERROR, $Options);
    }
1348885
public static function bind($key, $object = null)
    {
        if(is_array($key))
        {
            foreach($key as $key => $object)
            {
                self::$bindings[$key] = $object;
            }
        }
        else
        {
            self::$bindings[$key] = $object;
        }
    }
1249865
function addObject( $id, $options = 'add' )
    {
        // add the specified object to the page
        if ( isset( $this->looseObjects[$id] ) && $this->currentContents != $id )
        {
            // then it is a valid object, and it is not being added to itself
            switch ( $options )
            {
            case 'all':
                // then this object is to be added to this page (done in the next block) and
                // all future new pages.
                $this->addLooseObjects[$id] = 'all';
            case 'add':
                if ( isset( $this->objects[$this->currentContents]['onPage'] ) )
                {
                    // then the destination contents is the primary for the page
                    // (though this object is actually added to that page)
                    $this->o_page( $this->objects[$this->currentContents]['onPage'], 'content', $id );
                }
                break;
            case 'even':
                $this->addLooseObjects[$id] = 'even';
                $pageObjectId = $this->objects[$this->currentContents]['onPage'];
                if ( $this->objects[$pageObjectId]['info']['pageNum'] % 2 == 0 )
                {
                    $this->addObject( $id ); // hacky huh :)
                }
                break;
            case 'odd':
                $this->addLooseObjects[$id] = 'odd';
                $pageObjectId = $this->objects[$this->currentContents]['onPage'];
                if ( $this->objects[$pageObjectId]['info']['pageNum'] % 2 == 1 )
                {
                    $this->addObject( $id ); // hacky huh :)
                }
                break;
            case 'next':
                $this->addLooseObjects[$id] = 'all';
                break;
            case 'nexteven':
                $this->addLooseObjects[$id] = 'even';
                break;
            case 'nextodd':
                $this->addLooseObjects[$id] = 'odd';
                break;
            }
        }
    }