original_string: public function getNodeTypesByIds($ids)
      {
          if (empty($ids))
          {
              return null;
          }
  
          if (is_string($ids))
          {
              $ids = json_decode($ids, true);
          }
  
          if (is_array($ids) && ! empty($ids))
          {
              $model = $this->getModelName();
  
              $placeholders = implode(',', array_fill(0, count($ids), '?'));
  
              $nodeTypes = $model::whereIn('id', $ids)
                  ->orderByRaw('field(id,' . $placeholders . ')', $ids)
                  ->get();
  
              return (count($nodeTypes) > 0) ? $nodeTypes : null;
          }
  
          return null;
      }
code: public function getNodeTypesByIds($ids)
      {
          if (empty($ids))
          {
              return null;
          }
  
          if (is_string($ids))
          {
              $ids = json_decode($ids, true);
          }
  
          if (is_array($ids) && ! empty($ids))
          {
              $model = $this->getModelName();
  
              $placeholders = implode(',', array_fill(0, count($ids), '?'));
  
              $nodeTypes = $model::whereIn('id', $ids)
                  ->orderByRaw('field(id,' . $placeholders . ')', $ids)
                  ->get();
  
              return (count($nodeTypes) > 0) ? $nodeTypes : null;
          }
  
          return null;
      }
code_tokens: public function getNodeTypesByIds ( $ ids ) { if ( empty ( $ ids ) ) { return null ; } if ( is_string ( $ ids ) ) { $ ids = json_decode ( $ ids , true ) ; } if ( is_array ( $ ids ) && ! empty ( $ ids ) ) { $ model = $ this -> getModelName ( ) ; $ placeholders = implode ( ',' , array_fill ( 0 , count ( $ ids ) , '?' ) ) ; $ nodeTypes = $ model :: whereIn ( 'id' , $ ids ) -> orderByRaw ( 'field(id,' . $ placeholders . ')' , $ ids ) -> get ( ) ; return ( count ( $ nodeTypes ) > 0 ) ? $ nodeTypes : null ; } return null ; }
docstring: Returns node types by ids
  
  @param array|string $ids
  @return Collection
docstring_tokens: Returns node types by ids