将非对象转为对象，并且是同一个对象
@param object $object
@param boolean $isStore 是否存储该对象
@return object
973184
private static function parseObject($object, $isStore = true)
    {
        if(is_object($object))
        {
            return $object;
        }
        if(is_scalar($object))
        {
            if(isset(static::$objectMap[$object]))
            {
                return static::$objectMap[$object];
            }
            else if($isStore)
            {
                return static::$objectMap[$object] = (object)$object;
            }
            else
            {
                return (object)$object;
            }
        }
        else
        {
            // 其它
            if(false !== ($index = array_search($object, static::$otherMap, true)))
            {
                return static::$otherToObjectMap[$index];    
            }
            else if($isStore)
            {
                $key = spl_object_hash(new \stdclass);
                static::$otherMap[$key] = $object;
                return static::$otherToObjectMap[$key] = (object)$object;
            }
            else
            {
                return (object)$object;
            }
        }
    }
927438
public static function get($object): Proxy
    {
        if (self::$proxies === null) {
            self::$proxies = new \SplObjectStorage();
        }

        if (!isset(self::$proxies[$object])) {
            self::$proxies[$object] = new Proxy($object);
        }

        return self::$proxies[$object];
    }
408245
public function save($object)
    {
        $this->assertObjectInstance($object);

        $state = $this->getState($object);
        if ($state->isReadOnly()) {
            return null;
        }

        $relationsIterator = new \ArrayIterator($this->getRelations());

        $modifiedManyManyRelations = $this->handleManyManyRelations($state, $relationsIterator);
        $this->handleHasManyRelations($state, $relationsIterator);
        $this->handleHasOneRelations($state, $relationsIterator);

        switch ($state->getObjectState()) {
            case EntityState::STATE_NEW:
                $primaryKey = $this->insert($object);
                break;

            case EntityState::STATE_NEW_WITH_PRIMARY_KEY:
                $pkField    = $this->getPrimaryKey();
                $primaryKey = $state->getOriginalFieldData($pkField);

                //Check if the record exists in the database
                if ($this->exists($primaryKey)) {
                    //We may have no way of knowing what has changed, but assume that the primary key hasn't
                    //Let's assume that the original data is actually all new
                    $data = $this->toArray($object);

                    //But only update the primary key if it really has changed
                    if ($data[ $pkField ] === $primaryKey) {
                        unset($data[ $pkField ]);
                    }

                    $primaryKey = $this->update($object, $data);
                } else {
                    $primaryKey = $this->insert($object);
                }
                break;

            default:
                $data       = $state->getChangedFields();
                $primaryKey = $this->update($object, $data);
                break;
        }

        $state->setState(EntityState::STATE_HANDLED);
        $state->refreshOriginalData();

        $this->updateManyToManyRelations($modifiedManyManyRelations, $primaryKey);

        return $primaryKey;
    }
1060416
public static function initializeByObject(stdClass $Object) {
        $Receipt = new self();

        if (isset($Object->app_item_id)) {
            $Receipt->setAppItemId($Object->app_item_id);
        }

        if (isset($Object->bid)) {
            $Receipt->setBid($Object->bid);
        }

        if (isset($Object->bvrs)) {
            $Receipt->setBvrs($Object->bvrs);
        }

        if (isset($Object->product_id)) {
            $Receipt->setProductId($Object->product_id);
        }

        if (isset($Object->quantity)) {
            $Receipt->setQuantity($Object->quantity);
        }

        if (isset($Object->transaction_id)) {
            $Receipt->setTransactionId($Object->transaction_id);
        }

        if (isset($Object->original_transaction_id)) {
            $Receipt->setOriginalTransactionId($Object->original_transaction_id);
        }

        if (isset($Object->purchase_date)) {
            $Receipt->setPurchaseDate($Object->purchase_date);
        }

        if (isset($Object->original_purchase_date)) {
            $Receipt->setOriginalPurchaseDate($Object->original_purchase_date);
        }

        if (isset($Object->cancellation_date)) {
            $Receipt->setCancellationDate($Object->cancellation_date);
        }

        return $Receipt;
    }
960968
public static function from($object): self
    {
        if ($object instanceof self) {
            return $object;
        }

        if (\is_object($object)) {
            $object = \get_class($object);
        }

        if (! \is_string($object)) {
            throw new InvalidArgumentException('Cannot create a type from '.\gettype($object));
        }

        return new self($object);
    }
71386
private function copyObject($object)
  {
    $objectHash = spl_object_hash($object);

    if (isset($this->hashMap[$objectHash])) {
      return $this->hashMap[$objectHash];
    }

    $reflectedObject = new \ReflectionObject($object);

    if (false === $isCloneable = $reflectedObject->isCloneable() and $this->skipUncloneable) {
      $this->hashMap[$objectHash] = $object;
      return $object;
    }

    if (false === $isCloneable) {
      throw new \UnexpectedValueException(sprintf(
          'Class "%s" is not cloneable.',
          $object->getName()
      ));
    }

    $newObject = clone $object;
    $this->hashMap[$objectHash] = $newObject;

    foreach ($reflectedObject->getProperties() as $property) {
      $this->copyObjectProperty($newObject, $property);
    }

    return $newObject;
  }
139738
public function prepareObject($object)
    {
        $tokenList = $this->getMethodTokenList();

        for ($i = 0, $c = count($tokenList); $i < $c; $i++) {
            if ($this->reflection->hasMethod(self::SETTER_PREFIX . ucfirst($tokenList[$i]['property']))) {
                $m = self::SETTER_PREFIX . ucfirst($tokenList[$i]['property']);
                if ($tokenList[$i]['type'] == RouteMethodAnnotaionParser::TYPE_CLASS) {
                    $value = new $tokenList[$i]['value']();
                } else {
                    $value = $tokenList[$i]['value'];
                }
                $object->$m($value);
            }
        }

        return $object;
    }
1023477
public function hasOne($hasOne = null)
    {
        if ($hasOne === null)
        {
            return $this->_hasOne;
        }
        $this->_hasOne = $hasOne;

        return $this;
    }
670510
public function setObject( \Aimeos\Controller\Frontend\Iface $object )
	{
		parent::setObject( $object );

		$this->controller->setObject( $object );

		return $this;
	}
1218928
public function hasOne($model, $foreignKey = '', $localKey = '')
    {
        // 记录当前关联信息
        $model      = $this->parseModel($model);
        $localKey   = $localKey ?: $this->getPk();
        $foreignKey = $foreignKey ?: $this->getForeignKey($this->name);

        return new HasOne($this, $model, $foreignKey, $localKey);
    }
274252
public static function getFromObject($object, string $key)
    {
        if ($object == null) {
            return null;
        }
        if (!isset ($object->{$key})) {
            return null;
        }
        return $object->{$key};
    }
969044
public function first($object = false)
    {
        $this->prepare();

        $data = $this->_map;
        if (count($data) > 0) {
            return $this->prepareResult(reset($data), $object);
        }

        return null;
    }
1146728
public static function get(array $object, $keys)
    {
        $parts = explode('.', $keys);
        $key = array_shift($parts);

        if (isset($object[$key])) {
            if (!empty($parts) && is_array($object[$key])) {
                return static::get($object[$key], implode('.', $parts));
            }

            return $object[$key];
        }

        if (array_key_exists($key, $object)) {
            return null;
        }
        throw new \Exception("Key `{$keys}` doesn't exist for array keys [".implode(',', array_keys($object)).']');
    }
1084436
public function get($object, $key, $cache=null)
    {
        $query = $this->query(
            "{$this->foreign}=?", $object->get($this->local));

        return new Collection($this->class, $query, $this->adder($object));
    }
802447
public function deleteObject($bucket, $object, $options = NULL)
    {
        $this->precheckCommon($bucket, $object, $options);
        $options[self::OSS_BUCKET] = $bucket;
        $options[self::OSS_METHOD] = self::OSS_HTTP_DELETE;
        $options[self::OSS_OBJECT] = $object;
        $response = $this->auth($options);
        $result = new PutSetDeleteResult($response);
        return $result->getData();
    }
905596
protected static function configObject($object, array $options)
    {
        $options = self::checkOptions($options);
        foreach ($options as $name => $value) {
            $methodName = 'set' . ucfirst($name);
            if (!method_exists($object, $methodName)) {
                continue;
            }
            $object->$methodName($value);
        }

        return $object;
    }
1037988
public static function load() : UserStore
    {
        if (is_null(self::$instance)) {
            self::$instance = new UserStore(Connection::get());
        }

        return self::$instance;
    }