@param Configuration\TypeInterface $type
@param object $object
@param mixed[] $data
@param string $attribute

@return mixed[]
486747
private function processSerializeForType(Configuration\TypeInterface $type, $object, array $data, $attribute): array
    {
        if ($type instanceof Type\Method) {
            $data = $this->processSerializeTypeMethod($type, $object, $data, $attribute);
        } elseif ($type instanceof Type\Object) {
            $data = $this->processSerializeTypeObject($type, $object, $data, $attribute);
        } elseif ($type instanceof Type\Collection\Object) {
            $data = $this->processSerializeTypeCollectionObject($type, $object, $data, $attribute);
        } elseif ($type instanceof Type\IdentifiedObject) {
            $data = $this->processSerializeTypeIdentifiedObject($type, $object, $data, $attribute);
        } elseif ($type instanceof Type\Collection\IdentifiedObject) {
            $data = $this->processSerializeTypeCollectionObject($type, $object, $data, $attribute);
        } elseif ($type instanceof Type\Handler) {
            $data = $this->processSerializeTypeHandler($type, $object, $data, $attribute);
        }

        return $data;
    }
1357652
private function setArrayAndCheckNullWithKey(array $data, $object, $key, $attribute): array
    {
        $value = $this->setArray($object);

        if ($this->checkNullForAttribute($value, $key) === false) {
            $data[$attribute][$key] = $value;
        }

        return $data;
    }
462079
private function updateData(array $data, string $attribute, $attributeValue, string $class, ?string $format, array $context): array
    {
        if (null === $attributeValue && ($context[self::SKIP_NULL_VALUES] ?? $this->defaultContext[self::SKIP_NULL_VALUES] ?? false)) {
            return $data;
        }

        if ($this->nameConverter) {
            $attribute = $this->nameConverter->normalize($attribute, $class, $format, $context);
        }

        $data[$attribute] = $attributeValue;

        return $data;
    }
515822
public function getValuesData(AttributeInterface $attribute, array $context = null)
    {
        $this->checkAttribute($attribute);
        $valuesData = new ArrayCollection();
        try {
            foreach ($this->getValues($attribute, $context) as $value) {
                $valuesData->add($value->getValueData());
            }
        } catch (ExceptionInterface $e) {
            throw new InvalidValueDataException("Unable to access data for attribute {$attribute->getCode()}", 0, $e);
        }


        return $valuesData;
    }
1136291
public function json($data, $type = 'json') {
        switch (strtolower($type)) {
            case 'xml':
                return Factory::response()->xml($data);
            case 'jsonp':
                return Factory::response()->jsonp($data);
        }
        return Factory::response()->json($data);
    }
1241440
protected function getAttributeContext(
        DataInterface $object,
        $attribute,
        /* @noinspection PhpUnusedParameterInspection */
        $rawValue,
        array $context
    ) {
        $resolvedContext = parent::getAttributeContext($object, $attribute, $rawValue, $context);

        if (!\is_object($rawValue)) {
            return $resolvedContext;
        }

        $resolvedContext['resource_class'] = ClassUtils::getClass($rawValue);
        unset($resolvedContext['item_operation_name'], $resolvedContext['collection_operation_name']);

        return $resolvedContext;
    }
1337061
protected function getPHPType(
        FamilyInterface $family,
        AttributeInterface $attribute,
        $forceSingle = false
    ) {
        $type = substr($attribute->getType()->getDatabaseType(), 0, -\strlen('Value'));
        $collection = $attribute->isCollection() && !$forceSingle;

        // Scalar types
        if (\in_array($type, ['bool', 'integer', 'decimal', 'string', 'text'], true)) {
            if ('text' === $type) {
                return 'string';
            }
            if ('decimal' === $type) {
                return 'double';
            }
            if ($collection) {
                return $type.'[]|Collection';
            }

            return $type;
        }
        if (\in_array($type, ['date', 'datetime'], true)) {
            /** @noinspection ClassConstantCanBeUsedInspection */
            $type = '\DateTime';
            if ($collection) {
                $type .= '[]|Collection';
            }

            return $type;
        }
        if ('data' === $type || 'constrainedData' === $type) {
            $familyCodes = $attribute->getOption('allowed_families');
            if ($familyCodes) {
                if (!\is_array($familyCodes)) {
                    $familyCodes = [$familyCodes];
                }
                $types = [];
                foreach ($familyCodes as $familyCode) {
                    $types[] = $familyCode.($collection ? '[]' : '');
                    $family = $this->familyRegistry->getFamily($familyCode);
                    if ($family->getDataClass()) {
                        $types[] = '\\'.ltrim($family->getDataClass(), '\\').($collection ? '[]' : '');
                    }
                }
                if ($collection) {
                    $types[] = 'Collection';
                }

                return implode('|', $types);
            }

            // Couldn't find any family (rare case)
            if ($collection) {
                return 'Collection';
            }

            return 'mixed';
        }

        // Then there are the custom relation cases:
        $type = $this->getTargetClass($family, $attribute, $forceSingle);
        if ($type) {
            return $type;
        }

        // Fallback in any other case
        if ($collection) {
            return 'Collection';
        }

        return 'mixed';
    }
566476
public function parseType(Object\TypeObjectInterface $type, $data)
    {
        if($type instanceof Object\ReferentialInterface && $type->hasRef()) {
            $objectType = $type->getRef();
            $type = $this->resolveReference($type);
        } else {
            try {
                $objectType = $type->getType();
            } catch(SwaggerException\MissingDocumentPropertyException $e) {
                $objectType = null;
            }
        }
        
        if($objectType == 'array') {
            $schemaObject = [];
            
            $arrayItemType = $type->getItems();
            
            foreach($data as $key => $value) {
                $schemaObject[$key] = $this->parseType($arrayItemType, $value);
            }
        } elseif($type instanceof Object\Schema) {
            $schemaObject = new SchemaObject($objectType);
        
            foreach(array_keys(get_object_vars($data)) as $propertyKey) {
                try {
                    $propertySchema = $this->findSchemaForProperty($type, $propertyKey);
                } catch(SwaggerException\MissingDocumentPropertyException $e) {
                    throw (new SwaggerException\UndefinedPropertySchemaException)
                        ->setPropertyName($name)
                        ->setSchema($type);
                }
            
                $propertyValue = $this->parseType(
                    $propertySchema,
                    $data->$propertyKey
                );
                
                $schemaObject->setProperty($propertyKey, $propertyValue);
            }
        } else {
            $schemaObject = $data;
        }
        
        return $schemaObject;
    }
306157
private function readTypedAttributes(iterable $attributes, array $typeNames, AbstractPlatform $platform): iterable
    {
        foreach ($attributes as $name => $value) {
            yield $name => (array_key_exists($name, $typeNames) === true ?
                Type::getType($typeNames[$name])->convertToPHPValue($value, $platform) : $value);
        }
    }
836055
public function getValidationMessage($attribute, $rule, $data = [], $type = null)
    {
        $path = Str::snake($rule);
        if ($type !== null) {
            $path .= '.' . $type;
        }

        if ($this->translator->has('validation.custom.' . $attribute . '.' . $path)) {
            $path = 'custom.' . $attribute . '.' . $path;
        }

        $niceName = $this->getValidationAttribute($attribute);

        return $this->translator->get('validation.' . $path, $data + ['attribute' => $niceName]);
    }
231938
private function convertScalarFromPg($data, TypeInterface $type)
    {
        $converter = $this->getConverter($type);

        $data = $converter->fromPg($data, $type);

        if ($normalizer = $this->getNormalizer($type)) {
            $data = $normalizer->fromPg($data);
        }

        return $data;
    }
290805
public function vote(TokenInterface $token, $object, array $attributes)
    {
        if (!(($object instanceof Request) || $this->supportsAnyAttribute($attributes))) {
            return VoterInterface::ACCESS_ABSTAIN;
        }

        $requiredRole = $this->getRequiredRole($object);

        if (null === $requiredRole) {
            return VoterInterface::ACCESS_ABSTAIN;
        }

        $user = $token->getUser();

        if (!$user instanceof UserInformationInterface) {
            return VoterInterface::ACCESS_DENIED;
        }

        foreach ($user->getRoles() as $role) {
            if (strtoupper($role) == strtoupper($requiredRole)) {
                return VoterInterface::ACCESS_GRANTED;
            }
        }

        return VoterInterface::ACCESS_DENIED;
    }
1211771
public function delete_attribute( $type, $data ) {
		$type = $data['type'];
		unset( $data['type'] );
		return $this->post( 'attribute/' . $type, json_encode( $data ) );
	}
1235069
public function getFormOptions(AttributeInterface $attribute)
    {
        $formOptions = parent::getFormOptions($attribute);
        $formOptions['attribute'] = $attribute;

        return $formOptions;
    }
764211
public function getFieldsOfType($object, $type) {
		if (!is_object($object)) {
			throw new \InvalidArgumentException('No object provided');
		}
		$fields = array();

		$classMetadata = $this->metadataFactory->getMetadataForClass(get_class($object));

		foreach ($classMetadata->propertyMetadata as $propertyMetadata) {
			if (isset($propertyMetadata->toguType) && $propertyMetadata->toguType === $type) {
				if (!is_object($object)) {
					throw new \InvalidArgumentException('No object provided');
				}
				array_push($fields, $propertyMetadata);
			}
		}

		return $fields;
	}
853163
public function checkBoxListRow($model, $attribute, $data = array(), $htmlOptions = array())
	{
		return $this->inputRow(CiiInput::TYPE_CHECKBOXLIST, $model, $attribute, $data, $htmlOptions);
	}
795600
private function processSerializeTypeCollectionObject($objectType, $object, array $data, string $attribute): array
    {
        $subData = $object->{$objectType->getter()}();
        if ($this->checkNullForAttribute($subData, $attribute) === true) {
            return $data;
        }

        foreach ($subData as $key => $subObject) {
            $data = $this->setArrayAndCheckNullWithKey($data, $subObject, $key, $attribute);
        }

        return $data;
    }