Get the setters of an object

@param mixed $object
@return Collection\Method
967301
protected function getSetters($object)
    {
        // Get the current class
        $class = get_class($object);

        // Check if we have already parsed this class
        if (array_key_exists($class, $this->classMethodsCache) === true) {
            return $this->classMethodsCache[$class];
        }

        // Regex for parsing ReflectionParameter::__toString()
        $regex     = '/\[\s\<(?P<required>[^\>]+)\>\s' .
            '(?:(?P<typehint_a>[^\s]+|(?P<typehint_b>[^\s]+)\sor\s(?P<typehint_c>[^\s]+))\s)?' .
            '(?P<variable>\$[^\s]+)\s(?:=\s(?P<default>[^\]]+)\s)?\]/';

        // Make reflection and fetch the methods
        $reflectionClass = new ReflectionClass($object);
        $methods         = $reflectionClass->getMethods(ReflectionMethod::IS_PUBLIC);

        // Make result container
        $setters         = new Collection\Method();

        // Loop through the methods
        foreach ($methods as $method) {
            // We only care about the setters
            if (substr($method->getName(), 0, 3) !== 'set') {
                continue;
            }

            // Get parameter collection
            $parameters = $method->getParameters();

            // We only take care of the first parameter of the setter
            $parameter  = $parameters[0];
            $raw        = (string) $parameter;

            // If we cannot match it we continue
            if (($result = preg_match($regex, $raw, $matches)) === false || $result === 0) {
                continue;
            }

            // Parse the result of the regex
            $required = ($matches['required'] === 'required');
            $variable = $matches['variable'];
            $default  = $required ? null : $matches['default'];
            $typehint = null;

            // Advanced typehint detection
            if (empty($matches['typehint_b']) === false) {
                $typehint = $matches['typehint_b'];
            } else if (empty($matches['typehint_a']) === false){
                $typehint = $matches['typehint_a'];
            }

            // Set the correct default value
            switch ($default) {
                case null:
                case 'NULL':
                    $default = null;
                    break;
                case 'Array':
                    $default = array();
                    break;
                default:
                    $default = trim($default, "'");
                    break;
            }

            // Has it child objects
            $childObject = ($typehint !== null && $typehint !== 'array');

            // Set the results the the response object
            $setters->offsetSet(
                $method->getName(),
                new Entity\Method(
                    $required,
                    $default,
                    $typehint,
                    $childObject
                )
            );
        }

        // Return the just generated response
        return $this->classMethodsCache[$class] = $setters;
    }
1370603
public function isLabelSet($object)
    {
        $this->reflectionProperty->setAccessible(true);
        $v = $this->reflectionProperty->getValue($object);
        if (true === $v) {
            return true;
        }

        return false;
    }
741892
public static function functions($object)
    {
        return (is_array($object) || $object instanceOf \stdClass)
            ? static::keys(static::filter($object, function ($item) {
                return static::isFunction($item);
            }))
            : static::sortBy(get_class_methods($object), function($name) {
                return $name;
            });
    }
953126
protected function _getObjectFieldValues($object)
    {
        $result = array();
        $fields = $object->getFieldNames();
        $tableName = $object->getCoreTableName();
        foreach ($fields as $field) {
            $fieldName = $tableName.'__'.$field;
            $result[$field] = $object->$fieldName->value;
        }

        return $result;
    }
629312
protected function objectToArray($object) 
    {
        if (is_object($object)) {
            // Gets the properties of the given object
            // with get_object_vars function
            $object = get_object_vars($object);
        }

        if (is_array($object)) {
            /*
            * Return array converted to object
            * Using __FUNCTION__ (Magic constant)
            * for recursive call
            */
            return array_map(__METHOD__, $object);
        } else {
            // Return array
            return $object;
        }
    }
509410
public function items($object = null)
    {
        if (!$this->_items) {
            $this->_initItems();
        }
        
        $items = array();
        
        foreach ($this->_items as $item) {
            if ($object !== null && !$item->isApplicable($object)) {
                continue;
            }
            
            $items[] = $item;
        }
        
        return $items;
    }
1355811
public function extract( $object )
    {
        $data = $this->getMapper()
                     ->extract( $object );

        if ( isset( $data['properties'] ) &&
             is_array( $data['properties'] ) )
        {
            foreach ( $data['properties'] as $key => $value )
            {
                $newKey = String::camelize( $key );

                if ( is_array( $value ) &&
                     array_key_exists( 'value', $value ) )
                {
                    $data['properties'][$key] = $value['value'];
                }

                if ( $newKey != $key )
                {
                    $data['properties'][$newKey] = $data['properties'][$key];
                    unset( $data['properties'][$key] );
                }
            }
        }

        return $data;
    }
921028
public function preparePersistChangeSet($object) : array
    {
        if (! $object instanceof PersistableInterface) {
            throw new InvalidArgumentException(
                sprintf('%s must implement PersistableInterface.', get_class($object))
            );
        }

        return $object->preparePersistChangeSet();
    }
983158
protected function getObjectParams(DOMElement $object)
	{
		$params      = [];
		$settingName = strtolower($this->settingName);
		foreach ($object->getElementsByTagName('param') as $param)
		{
			$paramName = strtolower($param->getAttribute('name'));
			if ($paramName === $settingName && $param->parentNode->isSameNode($object))
			{
				$params[] = $param;
			}
		}

		return $params;
	}
1027765
public function getCustomFields($object)
    {
        $customFields = [];
        foreach ($object->getCustomFields() as $field) {
            $customFields[$field->getInternalFieldName()] = $field->getValue();
        }

        return $customFields;
    }
85047
public static function init($object, array $options)
    {
        foreach ($options as $property => $value) {
            if (is_numeric($property)) {
                continue;
            }

            $setter = 'set' . ucfirst($property);

            // has setter
            if (method_exists($object, $setter)) {
                $object->$setter($value);
            } else {
                $object->$property = $value;
            }
        }

        return $object;
    }
389401
public function readProperties($object)
    {
        if (!is_object($object)) {
            throw new InvalidArgumentException(1, 'object');
        }

        $reflector = new \ReflectionObject($object);
        $result    = array();

        // Iterate over the properties of the object.
        foreach ($reflector->getProperties() as $property) {
            $property->setAccessible(true);
            $result[$property->getName()] = $property->getValue($object);
        }

        return $result;
    }
1181256
private function _setFields($object, $fields)
    {
        $fields = is_array($fields) ? $fields : [];
        foreach ($fields as $sKey => $sValue) {
            $object->$sKey = oxNew('oxField', $sValue);
        }

        return $object;
    }
701851
public function extract( $object )
    {
        $values = array();

        foreach ( $object->settings as $key => $value )
        {
            switch ( true )
            {
                case $value instanceof StructureAbstract:
                    $values[$key] = $this->extract( $value );
                    break;

                case method_exists( $object, $method = 'extract' . ucfirst( $key ) ):
                    $values[$key] = $object->$method( $value );
                    break;

                default:
                    $values[$key] = $value;
            }
        }

        return $values;
    }
1021341
public static function fromObject($object)
    {
        if (\is_object($object)) {
            $object = (array)$object;
        }
        if (\is_array($object)) {
            $array = [];
            foreach ($object as $key => $value) {
                $array[$key] = self::fromObject($value);
            }
        } else {
            $array = $object;
        }
        return $array;
    }
1149677
private function extractObjectProperties($object)
    {
        $propertyToValue = [];

        if (method_exists($object, '__sleep')) {
            $properties = $object->__sleep();
            foreach ($properties as $property) {
                $propertyToValue[$property] = $object->$property;
            }

            return $propertyToValue;
        }


        $reflectedProperties = [];
        $ref = new \ReflectionClass($object);
        foreach ($ref->getProperties() as $property) {
            $property->setAccessible(true);
            $propertyToValue[$property->getName()] = $property->getValue($object);
            $reflectedProperties[] = $property->getName();
        }

        $dynamicProperties = array_diff(array_keys(get_object_vars($object)), $reflectedProperties);

        foreach ($dynamicProperties as $property) {
            $propertyToValue[$property] = $object->$property;
        }

        return $propertyToValue;
    }
1218904
public static function getExtractPropertys($object)
    {
        $list = AnnotationManager::getPropertiesAnnotations(BeanFactory::getObjectClass($object), ExtractProperty::class);
        if(null !== $list)
        {
            return $list;
        }
        else
        {
            return [];
        }
    }