@param Type\Object $objectType
@param object $object
@param mixed[] $data
@param string $attribute

@return mixed[]
164787
private function processSerializeTypeObject(Type\Object $objectType, $object, array $data, string $attribute): array
    {
        return $this->setArrayAndCheckNull($data, $object->{$objectType->getter()}(), $attribute);
    }
1061457
protected function getAttributeValue($object, $attribute, $format = null, array $context = [])
    {
        $context['api_attribute'] = $attribute;
        $propertyMetadata = $this->propertyMetadataFactory->create($context['resource_class'], $attribute, $this->getFactoryOptions($context));

        try {
            $attributeValue = $this->propertyAccessor->getValue($object, $attribute);
        } catch (NoSuchPropertyException $e) {
            if (!$propertyMetadata->hasChildInherited()) {
                throw $e;
            }

            $attributeValue = null;
        }

        $type = $propertyMetadata->getType();

        if (
            is_iterable($attributeValue) &&
            $type &&
            $type->isCollection() &&
            ($collectionValueType = $type->getCollectionValueType()) &&
            ($className = $collectionValueType->getClassName()) &&
            $this->resourceClassResolver->isResourceClass($className)
        ) {
            return $this->normalizeCollectionOfRelations($propertyMetadata, $attributeValue, $className, $format, $this->createChildContext($context, $attribute));
        }

        if (
            $type &&
            ($className = $type->getClassName()) &&
            $this->resourceClassResolver->isResourceClass($className)
        ) {
            return $this->normalizeRelation($propertyMetadata, $attributeValue, $className, $format, $this->createChildContext($context, $attribute));
        }

        unset($context['resource_class']);

        if (!$this->serializer instanceof NormalizerInterface) {
            throw new LogicException(sprintf('The injected serializer must be an instance of "%s".', NormalizerInterface::class));
        }

        return $this->serializer->normalize($attributeValue, $format, $context);
    }
1332070
public function batchReadByConst(array $objectTypeConsts) {
        $requests = [];

        foreach ($objectTypeConsts as $objectTypeConst) {
            $requests[] = [
                'method' => 'cmdb.object_type_categories.read',
                'params' => [
                    'type' => $objectTypeConst
                ]
            ];
        }

        return $this->api->batchRequest($requests);
    }
1115755
protected function processAttributeToResource($object, ResourceObject $resource, Attribute $definition)
    {
        $name   = $definition->getName();
        $getter = $definition->getGetter();

        $value = $object->$getter();

        if ($value === null && ! $definition->getProcessNull()) {
            return;
        }

        $value = $this->typeManager->toResource($definition, $value);

        $resource->setAttribute($name, $value);
    }
1150882
protected function extractEAVAttributes(DataInterface $object, $format = null, array $context = [])
    {
        $allowedAttributes = [];
        foreach ($object->getFamily()->getAttributes() as $attribute) {
            if ($this->isAllowedEAVAttribute($object, $attribute, $format, $context)) {
                $allowedAttributes[] = $attribute;
            }
        }

        return $allowedAttributes;
    }
429932
private function initializeObjectData(ObjectDataInterface $objectData)
    {
        // handle properties
        if ($objectData->getProperties() !== null) {
            $this->initializeObjectDataProperties($objectData->getProperties());
        }

        // handle allowable actions
        if ($objectData->getAllowableActions() !== null) {
            $this->allowableActions = $objectData->getAllowableActions();
            $this->extensions[(string) ExtensionLevel::cast(
                ExtensionLevel::ALLOWABLE_ACTIONS
            )] = $objectData->getAllowableActions()->getExtensions();
        }

        // handle renditions
        foreach ($objectData->getRenditions() as $rendition) {
            $this->renditions[] = $this->getObjectFactory()->convertRendition($this->getId(), $rendition);
        }

        // handle ACL
        if ($objectData->getAcl() !== null) {
            $this->acl = $objectData->getAcl();
            $this->extensions[(string) ExtensionLevel::cast(ExtensionLevel::ACL)] = $objectData->getAcl(
            )->getExtensions();
        }

        // handle policies
        if ($objectData->getPolicyIds() !== null) {
            $this->initializeObjectDataPolicies($objectData->getPolicyIds());
        }

        // handle relationships
        foreach ($objectData->getRelationships() as $relationshipData) {
            $relationship = $this->getObjectFactory()->convertObject(
                $relationshipData,
                $this->getCreationContext()
            );
            if ($relationship instanceof RelationshipInterface) {
                $this->relationships[] = $relationship;
            }
        }

        $this->extensions[(string) ExtensionLevel::OBJECT] = $objectData->getExtensions();
    }
847299
public static function getProperties(
        ?object $object,
        ?string $classOverride = null,
        ?int $propertyType = null
    ): array {
        $reflectionClass = self::getReflectionClass($object, $classOverride);
        $properties = [];
        $reflectionProperties = $reflectionClass->getProperties($propertyType);
        foreach ($reflectionProperties as $property) {
            $property->setAccessible(true);
            $properties[$property->getName()] = $property->getValue($object);
        }
        return $properties;
    }
216514
function unserializeContentObjectAttribute( $package, $objectAttribute, $attributeNode )
    {
        $timeNode = $attributeNode->getElementsByTagName( 'time' )->item( 0 );
        if ( is_object( $timeNode ) )
        {
            $timestamp = eZDateUtils::textToDate( $timeNode->textContent );
            $timeOfDay = null;
            if ( $timestamp >= 0 )
            {
                $time = new eZTime( $timestamp );
                $timeOfDay = $time->timeOfDay();
            }
            $objectAttribute->setAttribute( 'data_int', $timeOfDay );
        }
    }
53219
protected function getGenericObject($fieldName, $objectType, $objectName = "object")
    {
        //====================================================================//
        // Load Pointed Object Id
        $objectId = $this->getObjectId($fieldName, $objectName);
        //====================================================================//
        // Push Object Id to Buffer
        $this->out[$fieldName] = $objectId
                ? self::objects()->encode($objectType, $objectId)
                : null;

        return $this;
    }
987704
private function buildDataFromObject($object)
    {
        $result = array();

        $stack = new \SplStack();
        $stack->push($object);

        while (!$stack->isEmpty()) {
            $current = $stack->pop();
            if (is_object($current)) {
                array_push($result, $current);
            }

            foreach ($this->getDataFromItem($current) as $propertyName => $propertyValue) {
                if (is_object($propertyValue) || is_array($propertyValue)) {
                    $stack->push($propertyValue);
                }
            }
        }

        return $result;
    }
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;
    }
905353
private function getObjectLocalClass(string $objectType) : AbstractObject
    {
        //====================================================================//
        // Safety Check => Object Type is Mapped
        if (!in_array($objectType, array_keys(self::$objectsMap), true)) {
            throw new Exception(sprintf("Unknown Object Type : %s", $objectType));
        }
        //====================================================================//
        // Get Object Class
        $className = static::$objectsMap[$objectType];
        //====================================================================//
        // Safety Check => Validate Object Class
        if (true !== $this->isValidObjectClass($className)) {
            throw new Exception($this->isValidObjectClass($className));
        }
        //====================================================================//
        // Create Object Class
        $genericObject = new $className($this);
        //====================================================================//
        // If StandaloneObject => Configure it!
        if (is_subclass_of($className, AbstractStandaloneObject::class)) {
            $genericObject->configure($objectType, $this->getWebserviceId(), $this->getConfiguration());
        }

        return $genericObject;
    }
563434
public function buildObjectArray(array $data, $classname)
    {
        $objects = array();
        foreach ($data as $object) {
          $objects[] = new $classname($object);
        }
        return $objects;
    }
819609
protected function loadObject($objectTypePath, array $objectInfo)
    {
        $objectTypeInfo = explode(IObjectType::PATH_SEPARATOR, $objectTypePath, 2);
        if (count($objectTypeInfo) < 2) {
            throw new LoadEntityException($this->translate(
                'Cannot load object from data row. Object type path "{path}" is not correct.',
                ['path' => $objectTypePath]
            ));
        }

        list($objectCollectionName, $objectTypeName) = $objectTypeInfo;
        $objectCollection = $this->getCollectionManager()
            ->getCollection($objectCollectionName);
        $objectType = $objectCollection->getMetadata()
            ->getType($objectTypeName);

        $object = $objectCollection->loadObject($objectType, $objectInfo);

        return $object;
    }
1167411
public Object[] getAll(Map<String, Object> data, String attr) {
    return (Object[]) data.get(attr);
  }
695158
def get_objects_with_attribute(self, obj_type, attribute, value):
        
        return [o for o in self.get_objects_by_type(obj_type) if o.get_attribute(attribute) == value]
188697
private function processSerializeTypeMethod(Type\Method $method, $object, array $data, string $attribute): array
    {
        $value = $object->{$method->getter()}();

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

        return $data;
    }