protected function checkPropertyValue($object, $propertyName, array $propertyMetaData)
    {
        $propertyValue = ObjectAccess::getProperty($object, $propertyName, true);
        $propertyType = $propertyMetaData['type'];
        if ($propertyType === 'ArrayObject') {
            throw new PersistenceException('ArrayObject properties are not supported - missing feature?!?', 1283524355);
        }

        if (is_object($propertyValue)) {
            if ($propertyType === 'object') {
                if (!($propertyValue instanceof PersistenceMagicInterface)) {
                    throw new IllegalObjectTypeException('Property of generic type object holds "' . get_class($propertyValue) . '", which is not persistable (no entity or value object), in ' . get_class($object) . '::' . $propertyName, 1283531761);
                }
            } elseif (!($propertyValue instanceof $propertyType)) {
                throw new UnexpectedTypeException('Expected property of type ' . $propertyType . ', but got ' . get_class($propertyValue) . ' for ' . get_class($object) . '::' . $propertyName, 1244465558);
            }
        } elseif ($propertyValue !== null && $propertyType !== $this->getType($propertyValue)) {
            throw new UnexpectedTypeException('Expected property of type ' . $propertyType . ', but got ' . gettype($propertyValue) . ' for ' . get_class($object) . '::' . $propertyName, 1244465559);
        }

        return $propertyValue;
    }
protected function checkPropertyValue($object, $propertyName, array $propertyMetaData)
    {
        $propertyValue = ObjectAccess::getProperty($object, $propertyName, true);
        $propertyType = $propertyMetaData['type'];
        if ($propertyType === 'ArrayObject') {
            throw new PersistenceException('ArrayObject properties are not supported - missing feature?!?', 1283524355);
        }

        if (is_object($propertyValue)) {
            if ($propertyType === 'object') {
                if (!($propertyValue instanceof PersistenceMagicInterface)) {
                    throw new IllegalObjectTypeException('Property of generic type object holds "' . get_class($propertyValue) . '", which is not persistable (no entity or value object), in ' . get_class($object) . '::' . $propertyName, 1283531761);
                }
            } elseif (!($propertyValue instanceof $propertyType)) {
                throw new UnexpectedTypeException('Expected property of type ' . $propertyType . ', but got ' . get_class($propertyValue) . ' for ' . get_class($object) . '::' . $propertyName, 1244465558);
            }
        } elseif ($propertyValue !== null && $propertyType !== $this->getType($propertyValue)) {
            throw new UnexpectedTypeException('Expected property of type ' . $propertyType . ', but got ' . gettype($propertyValue) . ' for ' . get_class($object) . '::' . $propertyName, 1244465559);
        }

        return $propertyValue;
    }
protected function checkPropertyValue ( $ object , $ propertyName , array $ propertyMetaData ) { $ propertyValue = ObjectAccess :: getProperty ( $ object , $ propertyName , true ) ; $ propertyType = $ propertyMetaData [ 'type' ] ; if ( $ propertyType === 'ArrayObject' ) { throw new PersistenceException ( 'ArrayObject properties are not supported - missing feature?!?' , 1283524355 ) ; } if ( is_object ( $ propertyValue ) ) { if ( $ propertyType === 'object' ) { if ( ! ( $ propertyValue instanceof PersistenceMagicInterface ) ) { throw new IllegalObjectTypeException ( 'Property of generic type object holds "' . get_class ( $ propertyValue ) . '", which is not persistable (no entity or value object), in ' . get_class ( $ object ) . '::' . $ propertyName , 1283531761 ) ; } } elseif ( ! ( $ propertyValue instanceof $ propertyType ) ) { throw new UnexpectedTypeException ( 'Expected property of type ' . $ propertyType . ', but got ' . get_class ( $ propertyValue ) . ' for ' . get_class ( $ object ) . '::' . $ propertyName , 1244465558 ) ; } } elseif ( $ propertyValue !== null && $ propertyType !== $ this -> getType ( $ propertyValue ) ) { throw new UnexpectedTypeException ( 'Expected property of type ' . $ propertyType . ', but got ' . gettype ( $ propertyValue ) . ' for ' . get_class ( $ object ) . '::' . $ propertyName , 1244465559 ) ; } return $ propertyValue ; }
Check the property value for allowed types and throw exceptions for
unsupported types.

@param object $object The object with the property to check
@param string $propertyName The name of the property to check
@param array $propertyMetaData Property metadata
@return mixed The value of the property
@throws UnexpectedTypeException
@throws PersistenceException
@throws IllegalObjectTypeException
@api
Check the property value for allowed types and throw exceptions for unsupported types .