Fetch the variables from the given content type object.

@param $object
@param $fieldName
@param null $method

@return mixed|string
328948
public function getFieldValue($object, $fieldName, $method = null)
    {
        $getters = [];
        // prefer method name given in the code option
        if ($method) {
            $getters[] = $method;
        }

        $camelizedFieldName = self::camelize($fieldName, true);
        $getters[] = 'get'.$camelizedFieldName;
        $getters[] = 'is'.$camelizedFieldName;

        foreach ($getters as $getter) {
            if (method_exists($object, $getter)) {
                return call_user_func([$object, $getter]);
            }
        }

        return '';
    }
1291532
public function getField($fieldName)
    {
        if (array_key_exists($fieldName, $this->_message)) {
            return $this->_message[$fieldName];
        } else {
            return null;
        }
    }
899254
protected function getSimple($fieldName, $objectName = "object", $default = null)
    {
        if (isset($this->{$objectName}->{$fieldName})) {
            $this->out[$fieldName] = trim($this->{$objectName}->{$fieldName});
        } else {
            $this->out[$fieldName] = $default;
        }

        return $this;
    }
937525
public function get(string $variableName = null, int $type = Variables::TYPE_STRING)
    {
        if ($variableName === null) {
            throw new BadMethodCallException('Variable name must be specified');
        }
        if (isset($this->variables[$variableName])) {
            return $this->cast($this->variables[$variableName], $type);
        }
        return $this->cast(null, $type);
    }
628750
protected function getMethodInstance(&$object, $methodName)
    {
        $method = new ReflectionMethod(get_class($object), $methodName);
        $method->setAccessible(true);

        return $method;
    }
39715
public function getPropertiesLoadedTogether($object, $propertyName)
    {
        $metadata = $this->getMetadata(get_class($object));
        return $metadata->getFieldsWithSameDataSource($propertyName);
    }
715185
public function injectIntoMethod( $object, $methodName = "injectDependencies" ){
        $ref = new \ReflectionClass($object);
        try{
            $refMethod = $ref->getMethod( $methodName );
        }catch( ReflectionException  $e ){
            return null;
        }
        
        $toInject = [];
        foreach ($refMethod->getParameters() as $p) {
            $className = $p->getClass()->name;
            if( $className === "Pimple\\Container" ){
                $toInject[] = $this->container;
            }else{
                $toInject[] = $this->container[ $className ];
            }
        }
        return $refMethod->invoke( $object, ... $toInject );
    }
837292
function (methodName) {
            var params = this.getParameters(methodName),
                ret;
            params.forEach(function (param) {
                if (param && (param.envelope === 'JSON' ||
                        param.envelope === 'ENTITY')) {
                    ret = param;
                }
            });
            return ret;
        }
130035
public function get($name = null, $domain = null, $method = '*')
    {
        if (is_null($name)) {
            return $this->item;
        }

        $name = strtolower($name);
        $method = strtolower($method);

        if (isset($this->item[$name])) {
            if (is_null($domain)) {
                $result = $this->item[$name];
            } else {
                $result = [];
                foreach ($this->item[$name] as $item) {
                    if ($item[2] == $domain && ('*' == $item[4] || $method == $item[4])) {
                        $result[] = $item;
                    }
                }
            }
        } else {
            $result = null;
        }

        return $result;
    }
727407
public function getVariables( $method )
	{
		if( !strlen( $method = trim( $method ) ) )
			return $this->methods;
		if( !array_key_exists( $method, $this->methods ) )
			throw new InvalidArgumentException( 'Method "'.$method.'" not found' );
		return $this->methods[$method]['variables'];
	}
1340820
public static function setFieldValue(PageInterface $object, $fieldName, $value, $method = null)
    {
        $setters = [];

        // prefer method name given in the code option
        if ($method) {
            $setters[] = $method;
        }

        $camelizedFieldName = self::camelize($fieldName);
        $setters[] = 'set'.$camelizedFieldName;

        foreach ($setters as $setter) {
            if (method_exists($object, $setter)) {
                call_user_func([&$object, $setter], $value);

                return $object;
            }
        }

        if ($object->getId()) {
            throw new NoValueException(sprintf('Unable to set the value of `%s`', $camelizedFieldName));
        }

        return $object;
    }
1110892
public function getObjectData(Varien_Object $object, $key = null)
    {
        if ($key) {
            return $object->getDataUsingMethod($key);
        } else {
            return $object->getData();
        }
    }
488703
public static function collect(string $className, $objectAnnotation = null, string $propertyName = '', string $methodName = '', $propertyValue = null)
    {
        if ($objectAnnotation instanceof Reference) {
            // phpdoc解析
            $phpReader     = new PhpDocReader();
            $property      = new \ReflectionProperty($className, $propertyName);
            $propertyClass = $phpReader->getPropertyClass($property);
            $name          = $objectAnnotation->getName();
            $pool          = $objectAnnotation->getPool();
            $version       = $objectAnnotation->getVersion();
            $breaker       = $objectAnnotation->getBreaker();
            $packer        = $objectAnnotation->getPacker();
            $fallback      = $objectAnnotation->getFallback();

            $className      = sprintf("%s.%s.%s.%s.%s.%s", $name, $propertyClass, $version, $pool, $breaker, $packer);
            $className      = md5($className);
            $proxyClassName = str_replace("\\", '_', $propertyClass);
            $className      = $proxyClassName . '_' . $className;

            if (empty($name)) {
                throw new RpcClientException('@Reference must be define name! ');
            }
            if (isset(self::$references[$className])) {
                return $className;
            }

            self::$references[$className] = [
                $name,
                $propertyClass,
                $version,
                $pool,
                $breaker,
                $packer,
                $fallback
            ];

            return $className;
        }

        return null;
    }
1044677
private JMethod getMethodsMap(MethodType type, JFieldVar field, ClassOutline co) {
        String getterBody = "return " + field.name() + ";";
        for (JMethod method : co.implClass.methods()) {
            String name = method.name();
            if (method.type().isPrimitive()) {
                if (MethodType.GETTER == type && (name.startsWith("is") || name.startsWith("get"))) {
                    JStatement o = (JStatement) method.body().getContents().get(0);
                    String s = getterBody(o);
                    if (s.trim().equals(getterBody)) {
                        return method;
                    }
                } else if (MethodType.SETTER == type && name.startsWith("set")) {
                    JStatement o = (JStatement) method.body().getContents().get(0);
                    String s = setterBody(o);
                    if (s.startsWith("this." + field.name() + " =")) {
                        return method;
                    }
                }
            }

        }
        throw new RuntimeException("Failed to find " + type + " for " + field.name() + ", disable XReplacePrimitives and report a bug");
    }
987879
public static Field getField(String fieldName, Object object) {
    return getField(fieldName, object.getClass());
  }
1358442
private function proxyBean(string $name, string $className, $object)
    {
        if (!AspectCollector::hasClassname($className)) {
            return $object;
        }

        /* @var Aop $aop */
        $aop = App::getBean(Aop::class);

        $rc  = new \ReflectionClass($className);
        $rms = $rc->getMethods();
        foreach ($rms as $rm) {
            $method      = $rm->getName();
            $annotations = Collector::$methodAnnotations[$className][$method] ?? [];
            $annotations = array_unique($annotations);
            $aop->match($name, $className, $method, $annotations);
        }

        $handler = new AopHandler($object);

        return Proxy::newProxyInstance(\get_class($object), $handler);
    }
914167
public function parser(string $className, $objectAnnotation = null, string $propertyName = "", string $methodName = "", $propertyValue = null)
    {
        $scope    = Scope::PROTOTYPE;
        $name     = $objectAnnotation->getName();
        $beanName = empty($name) ? $className : $name;

        ProcessCollector::collect($className, $objectAnnotation, $propertyName, $methodName, $propertyValue);

        return [$beanName, $scope, ""];
    }