Parses the data for this element

@param mixed $object The data

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

        foreach (get_object_vars($object) as $name => $value) {
            $this->setLink($name, $value);
        }
    }
300284
protected function validateAttribute($object, $attribute)
    {
        $value = $object->{$attribute};
        if ($this->isEmpty($value)) {
            $this->validateEmpty($object, $attribute);
            return;
        }
        if (
            (!$this->strict && $value != $this->trueValue && $value != $this->falseValue)
            || ($this->strict && $value !== $this->trueValue && $value !== $this->falseValue)
        ) {
            $this->addError($object, $attribute, $this->message, [
                '{true}' => $this->trueValue,
                '{false}' => $this->falseValue,
            ]);
        }
    }
716694
protected function parseToArray($object): array
    {
        if (!is_array($object)) {
            $attributes = method_exists($object, 'getAttributes')
                ? $object->getAttributes()
                : get_object_vars($object);

            return $attributes;
        }

        return $object;
    }
280994
public function validateData(\Magento\Framework\DataObject $dataObject)
    {
        $result = [];
        $fromDate = $toDate = null;

        if ($dataObject->hasFromDate() && $dataObject->hasToDate()) {
            $fromDate = $dataObject->getFromDate();
            $toDate = $dataObject->getToDate();
        }

        if ($fromDate && $toDate) {
            $fromDate = $this->dateFilter->filter($fromDate);
            $toDate = $this->dateFilter->filter($toDate);

            if ($fromDate > $toDate) {
                $result[] = __('End Date must follow Start Date.');
            }
        }

        return !empty($result) ? $result : true;
    }
797681
public function extract($object)
    {
        if (! $object instanceof ConversionInterface) {
            throw new InvalidArgumentException(sprintf(
                'Invalid object "%s" provided; must be an instance of "%s".',
                is_object($object) ? get_class($object) : gettype($object),
                ConversionInterface::CLASS
            ));
        }

        return $object->toArray();
    }
1283836
protected function parse($object)
    {
        if (! is_object($object)) {
            throw new ValidationException('Relationships has to be an object, "' . gettype($object) . '" given.');
        }

        if (property_exists($object, 'type') or property_exists($object, 'id')) {
            throw new ValidationException('These properties are not allowed in attributes: `type`, `id`');
        }

        $object_vars = get_object_vars($object);

        if (count($object_vars) === 0) {
            return $this;
        }

        foreach ($object_vars as $name => $value) {
            if ($this->getParent()->has('attributes.' . $name)) {
                throw new ValidationException('"' . $name . '" property cannot be set because it exists already in parents Resource object.');
            }

            $this->set($name, $this->create('Relationship', $value));
        }
    }
244683
public static function parse($object){
		
		$num = \preg_replace('/[^\.\d]/', '', \strval($object));
		
		list($m, $d) = \explode('.', $num, 2);
		
		$mLen = \strlen($m);
		$dLen = \strlen($d);
				
		if(!Number::between($mLen, MySQL::getConstant('DECIMAL_M_MIN'),
				MySQL::getConstant('DECIMAL_M_MAX'))){
			return null;
		}
		
		if(!Number::between($dLen, MySQL::getConstant('DECIMAL_D_MIN'),
				MySQL::getConstant('DECIMAL_D_MAX'))){
			return null;
		}
		
		if($dLen > $mLen){
			return null;
		}
		
		return new static($mLen, $dLen);
		
	}
612288
public function load($object)
    {
        if (get_class($object) !== $this->objectClass) {
            throw new \LogicException(sprintf('Invalid object type. Expected "%s" but got "%s".', $this->objectClass, get_class($object)));
        }

        $hydrator = $this->objectManager->getHydratorFor($this->objectClass);
        $hydrator->load($object);
    }
1055609
protected function parse($object)
    {
        if (! is_array($object)) {
            throw new ValidationException('Resources for a collection has to be in an array, "' . gettype($object) . '" given.');
        }

        if (count($object) > 0) {
            foreach ($object as $resource) {
                $this->set('', $this->parseResource($resource));
            }
        }
    }
1315867
public function checkIsEntity($object)
    {
        if (!$object instanceof $this->entityName) {
            throw InvalidArgumentException::invalidEntityType(
                $this->getEntityName(),
                $object
            );
        }
    }
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;
    }
480938
public function extract($object)
    {
        $data = parent::extract($object);
        $data['description-description']    = $this->extractValue('descriptiondescription', $object);
        $data['description-requirements']   = $this->extractValue('descriptionrequirements', $object);
        $data['description-benefits']       = $this->extractValue('descriptionbenefits', $object);
        $data['description-qualifications'] = $this->extractValue('descriptionqualifications', $object);
        $data['description-title']          = $this->extractValue('descriptiontitle', $object);

        $data['description-html']           = $object->getTemplateValues()->getHtml();
        return $data;
    }
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 ];
    }
760144
protected function validate($object): void
    {
        $needType = $this->type();

        if (!$object instanceof $needType) {
            throw new \InvalidArgumentException("Element " . get_class($object) . " must be instance of " . $needType);
        }
    }
1079454
protected function validateAttribute($object,$attribute)
	{
		if(!$this->setOnEmpty)
			$object->$attribute=$this->value;
		else
		{
			$value=$object->$attribute;
			if($value===null || $value==='')
				$object->$attribute=$this->value;
		}
	}
927206
public function validate(array $object, Schema $schema, array $schemaExtensions = [])
    {
        $validationResult = new ValidationResult();
        /** @var Schema[] $otherSchemas */
        $otherSchemas = [];
        foreach ($schemaExtensions as $schemaExtension) {
            $otherSchemas[$schemaExtension->getId()] = $schemaExtension;
        }

        $this->validateByAttributes($object, $schema->getId(), $schema->getAttributes(), $otherSchemas, $validationResult, null);

        foreach ($otherSchemas as $schemaId => $otherSchema) {
            if (isset($object[$schemaId])) {
                $this->validateByAttributes($object[$schemaId], $otherSchema->getId(), $otherSchema->getAttributes(), [], $validationResult, null);
            }
        }

        return $validationResult;
    }
1018430
public function isValueObject($object)
    {
        if (!is_string($object)) {
            $object = get_class($object);
        }

        return array_key_exists($object, $this->valueClasses);
    }