public static function getClassMetaSettings(
        Model $model,
        $class = null,
        $method = 'getMetaSettings'
    ) {
        $metaSettings = [];
        if ($class) {
            $r = new \ReflectionClass($class);
        } else {
            $r = new \ReflectionObject($model);
        }
        if ($r->hasMethod($method)) {
            $metaMeth = $r->getMethod($method);
            $declaringClass = $metaMeth->getDeclaringClass()->getName();
            if (strtolower($r->getName()) === strtolower($declaringClass)) {
                if ($class) {
                    $method = sprintf('%s::%s', $class, $method);
                }
                $metaSettings = static::invokeCallable([$model, $method]);
            }
        }

        return $metaSettings;
    }
public static function getClassMetaSettings(
        Model $model,
        $class = null,
        $method = 'getMetaSettings'
    ) {
        $metaSettings = [];
        if ($class) {
            $r = new \ReflectionClass($class);
        } else {
            $r = new \ReflectionObject($model);
        }
        if ($r->hasMethod($method)) {
            $metaMeth = $r->getMethod($method);
            $declaringClass = $metaMeth->getDeclaringClass()->getName();
            if (strtolower($r->getName()) === strtolower($declaringClass)) {
                if ($class) {
                    $method = sprintf('%s::%s', $class, $method);
                }
                $metaSettings = static::invokeCallable([$model, $method]);
            }
        }

        return $metaSettings;
    }
public static function getClassMetaSettings ( Model $ model , $ class = null , $ method = 'getMetaSettings' ) { $ metaSettings = [ ] ; if ( $ class ) { $ r = new \ ReflectionClass ( $ class ) ; } else { $ r = new \ ReflectionObject ( $ model ) ; } if ( $ r -> hasMethod ( $ method ) ) { $ metaMeth = $ r -> getMethod ( $ method ) ; $ declaringClass = $ metaMeth -> getDeclaringClass ( ) -> getName ( ) ; if ( strtolower ( $ r -> getName ( ) ) === strtolower ( $ declaringClass ) ) { if ( $ class ) { $ method = sprintf ( '%s::%s' , $ class , $ method ) ; } $ metaSettings = static :: invokeCallable ( [ $ model , $ method ] ) ; } } return $ metaSettings ; }
Returns meta settings related to the passed in model instance, passed in
class.

@param Model  $model
@param null   $class  this most of the time will be a parent in the models
hierarchy that we want to get its settings if it all it set any
@param string $method

@return array|mixed
Returns meta settings related to the passed in model instance passed in class .