src/Repositories/NodeTypeRepository.php
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;
    }
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;
    }
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 ; }
Returns node types by ids

@param array|string $ids
@return Collection
Returns node types by ids