public static function isMetaInScope(NodeSchema $schema, NodePartials $nodePartials, $id)
 {
     $partials = self::unserializeMetaPartials($nodePartials->getMetaPartials());
     $re_partials = self::unserializeMetaPartials($nodePartials->getRestrictedMetaPartials());
     $id = strtolower(ltrim($id, '#'));
     foreach ((array) $re_partials as $partial) {
         if ($partial->getMetaName() == $id) {
             return false;
         }
     }
     if ($partials == 'all') {
         return true;
     }
     // will throw Exception is schema def doesn't exist
     try {
         $schema->getMetaDef($id);
     } catch (SchemaException $se) {
         return false;
     }
     $inScope = false;
     foreach ($partials as $partial) {
         if ($partial->getMetaName() == $id) {
             $inScope = true;
             break;
         }
     }
     if (!$inScope) {
         return false;
     }
     return true;
 }