src/MediaServices/Internal/ContentPropertiesSerializer.php
private static function _isRequired($object, $fieldName)
    {
        $reflectionClass = new \ReflectionClass($object);
        if ($reflectionClass->hasMethod('requiredFields')) {
            return in_array($fieldName, $object->requiredFields());
        }

        return false;
    }
private static function _isRequired($object, $fieldName)
    {
        $reflectionClass = new \ReflectionClass($object);
        if ($reflectionClass->hasMethod('requiredFields')) {
            return in_array($fieldName, $object->requiredFields());
        }

        return false;
    }
private static function _isRequired ( $ object , $ fieldName ) { $ reflectionClass = new \ ReflectionClass ( $ object ) ; if ( $ reflectionClass -> hasMethod ( 'requiredFields' ) ) { return in_array ( $ fieldName , $ object -> requiredFields ( ) ) ; } return false ; }
Returns true if the specified filed y required for the specified entity.

@param mixed  $object    the entity
@param string $fieldName the property name to verify if it's required or not

@return bool
Returns true if the specified filed y required for the specified entity .