Parses the data for this element

@param mixed $object The data

@throws ValidationException
965798
protected function parse($object)
    {
        if (! is_object($object)) {
            throw new ValidationException('Jsonapi has to be an object, "' . gettype($object) . '" given.');
        }

        if (property_exists($object, 'version')) {
            if (is_object($object->version) or is_array($object->version)) {
                throw new ValidationException('property "version" cannot be an object or array, "' . gettype($object->version) . '" given.');
            }

            $this->set('version', strval($object->version));
        }

        if (property_exists($object, 'meta')) {
            $this->set('meta', $this->create('Meta', $object->meta));
        }
    }
1047680
public function toObject(array $data, $object)
    {
        $className = $this->getFullClassName($object);
        $metadata = $this->metadataFactory->getMetadataForClass($className);
        $unserializedProperties = 0;
        foreach ($metadata->getProperties() as $property) {
            if (!$property->isExpose() || $this->propertySkipper->shouldSkip($property)) {
                if ($this->isMediumStrictUnserializeMode() && array_key_exists($property->getSerializedName(), $data)) {
                    throw new InvalidArgumentException(sprintf('%s extra field', $property->getSerializedName()));
                }
                continue;
            }

            if (!array_key_exists($property->getSerializedName(), $data)) {
                if ($this->isStrictUnserializeMode()) {
                    throw new InvalidArgumentException(sprintf('%s field is lost', $property->getSerializedName()));
                }
                continue;
            }
            $value = $this->handleValue($data[$property->getSerializedName()], $property, self::DIRECTION_UNSERIALIZE, $object);

            if ($value === $object) {
                throw new RecursionException(sprintf('Invalid self reference detected. %s::%s', $className, $property->getName()));
            }

            $this->involveValue($object, $property, $value);
            $unserializedProperties ++;
        }

        if ($this->isMediumStrictUnserializeMode() && $unserializedProperties !== count($data)) {
            throw new InvalidArgumentException('Wrong number of fields in the deserialized data');
        }

        return $object;
    }
519478
public function getObjectValidator($object)
    {
        $class = get_class($object);
        if (!isset($this->validators[ $class ])) {
            $this->validators[ $class ] = $this->reader->getObjectValidator($object);
        }

        return $this->validators[ $class ];
    }
737705
function validateObject(node, schema, key) {
    if (typeof node == "object") {
      try {
        validateModel(node, schema[SCHEMADATA]);
      } catch (e) {
        throw new ValidationException(e.message + " at " + key + ".");
      }
    } else {
      throw new ValidationException("Expected object for " + key);
    }
  }
864829
private function convert(Array $object): Array {
    $parse = Array();
    foreach ($object as $key => $value) {
      if ($value instanceof stdClass) {
        $parse[$key] = $this->convert((Array) $value);
      } else {
        $parse[$key] = $value;
      }
    }
    return $parse;
  }
1320445
protected function validateAttribute($object,$attribute)
	{
		$value=$object->$attribute;
		if($this->allowEmpty && $this->isEmpty($value))
			return;

		if(!$this->validateValue($value))
		{
			$message=$this->message!==null?$this->message:Yii::t('yii','{attribute} is not a valid email address.');
			$this->addError($object,$attribute,$message);
		}
	}
45095
public function getRequestString($object): string
    {
        $this->assertValid($object, ValidationException::RESPONSE);

        return $this->serializeBodyObject($object);
    }
1123119
public function extract($object)
    {
        if (!$object instanceof BlockEntityInterface) {
            throw new Exception\InvalidArgumentException(
                '$object must be an instance of PlaygroundCms\Entity\BlockInterface'
            );
        }

        /* @var $object BlockInterface*/
        $data = parent::extract($object);
        //$data = $this->mapField('id', 'block_id', $data);
        return $data;
    }
751320
protected function prepare($object)
    {
        $this->metadata = $this->objectManager->getClassMetadata(get_class($object));
        $this->prepareStrategies();
    }
1079710
protected function doExtract($object)
    {
        $originalFieldNames = $this->metadata->getOriginalFieldNames();

        /*
        $filter = $object instanceof FilterProviderInterface
            ? $object->getFilter()
            : $this->filterComposite;
        */

        $data = [];
        if (! $this->metadata->hasCustomHydrator()) {

            $this->executeMethods($object, $this->metadata->getPreExtractListeners());

            foreach ($originalFieldNames as $originalFieldName) {
                $mappedFieldName = $this->metadata->getMappedFieldName($originalFieldName);

                if ($this->metadata->isNotManaged($mappedFieldName)) {
                    continue;
                }

                if ($this->metadata->isValueObject($mappedFieldName)) {
                    continue;
                }

                /*if ($filter && !$filter->filter($mappedFieldName)) {
                    continue;
                }*/

                try {
                    $value = $this->memberAccessStrategy->getValue($object, $mappedFieldName);             
                } catch (NotFoundMemberException $e) {
                    continue;
                }

                if (null === $value) {
                    $data[$originalFieldName] = null;
                    continue;
                }

                if ($fieldClass = $this->metadata->getClassOfMappedField($mappedFieldName)) {
                    $fieldHydrator = $this->objectManager->createHydratorFor($fieldClass);
                    $fieldValue = $value;

                    /*if (! is_array($fieldValue)) {
                        throw new ObjectMappingException(
                            sprintf(
                                'Cannot hydrate field "%s" of class "%s" from raw data.'
                                . ' Raw data should be an array but got "%s".', 
                                $mappedFieldName,
                                $fieldClass,
                                is_object($fieldValue) ? get_class($fieldValue) : gettype($fieldValue)
                                )
                        );
                    }   */
                    
                    reset($fieldValue);
                    if (0 !== count($fieldValue) && ! is_numeric(key($fieldValue))) {
                        $fieldRawData = $fieldHydrator->extract($fieldValue);
                        $data[$originalFieldName] = $fieldRawData;                              
                    } else {

                        $fieldRawData = [];
                        foreach ($fieldValue as $itemFieldValue) {              
                            $fieldRawData[] = $fieldHydrator->extract($itemFieldValue);                
                        }
                        $data[$originalFieldName] = $fieldRawData;
                    }   
                } else {
                    $value = $this->extractValue($mappedFieldName, $value, $object, $data);
                    $data[$originalFieldName] = $value;    
                }
            }
        } else {
            list($customHydratorClass, , $customExtractMethod) = $this->metadata->getCustomHydratorInfo();            
            $this->executeMethod($object, new ClassMetadata\Model\Method($customHydratorClass, $customExtractMethod, [$object]));
        }

        //Value objects extraction.
        foreach ($this->metadata->getFieldsWithValueObjects() as $mappedFieldName) {

            if ($this->metadata->isNotManaged($mappedFieldName)) {
                continue;
            }

            $info = $this->metadata->getValueObjectInfo($mappedFieldName);
            list($voClassName, $voResource, $voResourceType) = $info;

            $valueObjectHydrator = $this->objectManager->createHydratorFor($voClassName);
            $objectKey = $this->pushRuntimeConfiguration($mappedFieldName, $object, $voClassName, $voResourceType, $voResource);

            $valueObject = $this->memberAccessStrategy->getValue($object, $mappedFieldName);
            $valueObjectData = $valueObjectHydrator->extract($valueObject, $objectKey);
            $this->popRuntimeConfiguration();

            $data = array_merge($data, $valueObjectData);
        }

        $this->executeMethods($object, $this->metadata->getPostExtractListeners());

        return $data;
    }
775375
function getData($object)
    {
        if (! $this->has($object) )
            throw new \Exception('Object Not Found.');


        $hash = $this->genETag($object);
        return $this->_objs[$hash]['data'];
    }
164732
protected function validate($object)
    {
        $object = (object) $object;

        if ($object instanceof $this->is) {
            return $object;
        }

        throw new \DomainException(
            sprintf(
                "The Asset advertised as being of type %s is actually of type %s",
                $this->is,
                get_class($object)
            )
        );
    }
1321636
public function readObject($object = null)
    {
        if ($object === null) {
            $object = array();
        }

        while (true) {
            $key        = $this->_stream->readUTF();
            $typeMarker = $this->_stream->readByte();
            if ($typeMarker != Zend_Amf_Constants::AMF0_OBJECTTERM ){
                //Recursivly call readTypeMarker to get the types of properties in the object
                $object[$key] = $this->readTypeMarker($typeMarker);
            } else {
                //encountered AMF object terminator
                break;
            }
        }
        $this->_reference[] = $object;
        return (object) $object;
    }
71518
protected function parse($object)
    {
        if (! is_object($object)) {
            throw new ValidationException('Link has to be an object or string, "' . gettype($object) . '" given.');
        }

        if (! array_key_exists('href', $object)) {
            throw new ValidationException('Link must have a "href" attribute.');
        }

        foreach (get_object_vars($object) as $name => $value) {
            $this->setAsLink($name, $value);
        }
    }
1041730
public function extract($object)
    {
        if (!$object instanceof User) {
            throw new \Exception('$object must be an instance of User');
        }
        /* @var $object User */
        $data = parent::extract($object);

        return $data;
    }
444878
protected function checkRules($object)
    {
        $this->assertTrue(property_exists($object, 'rules'));

        $this->assertInternalType('array', $object->rules);

        foreach ($object->rules as $rule) {
            $this->checkRule($rule);
        }
    }
350949
public function extract($object)
    {
        if (!$object instanceof PageEntityInterface) {
            throw new Exception\InvalidArgumentException(
                '$object must be an instance of PlaygroundCms\Entity\PageInterface'
            );
        }

        /* @var $object PageInterface*/
        $data = parent::extract($object);
        $data = $this->mapField('id', 'page_id', $data);

        return $data;
    }