public function getTracks(int $start = 0, int $total = 0): array
    {
        $tracks = [];

        if ($total > 0 && $total < 100) {
            $limit = $total;
        } else {
            $limit = 100;
        }

        do {
            $data = $this->browse("DirectChildren", $start, $limit);
            $parser = new XmlParser($data["Result"]);
            foreach ($parser->getTags("item") as $item) {
                $tracks[] = $this->trackFactory->createFromXml($item);
                if ($total > 0 && count($tracks) >= $total) {
                    return $tracks;
                }
            }

            $start += $limit;
        } while ($data["NumberReturned"] && $data["TotalMatches"] && count($tracks) < $data["TotalMatches"]);

        return $tracks;
    }
public function getTracks(int $start = 0, int $total = 0): array
    {
        $tracks = [];

        if ($total > 0 && $total < 100) {
            $limit = $total;
        } else {
            $limit = 100;
        }

        do {
            $data = $this->browse("DirectChildren", $start, $limit);
            $parser = new XmlParser($data["Result"]);
            foreach ($parser->getTags("item") as $item) {
                $tracks[] = $this->trackFactory->createFromXml($item);
                if ($total > 0 && count($tracks) >= $total) {
                    return $tracks;
                }
            }

            $start += $limit;
        } while ($data["NumberReturned"] && $data["TotalMatches"] && count($tracks) < $data["TotalMatches"]);

        return $tracks;
    }
public function getTracks ( int $ start = 0 , int $ total = 0 ) : array { $ tracks = [ ] ; if ( $ total > 0 && $ total < 100 ) { $ limit = $ total ; } else { $ limit = 100 ; } do { $ data = $ this -> browse ( "DirectChildren" , $ start , $ limit ) ; $ parser = new XmlParser ( $ data [ "Result" ] ) ; foreach ( $ parser -> getTags ( "item" ) as $ item ) { $ tracks [ ] = $ this -> trackFactory -> createFromXml ( $ item ) ; if ( $ total > 0 && count ( $ tracks ) >= $ total ) { return $ tracks ; } } $ start += $ limit ; } while ( $ data [ "NumberReturned" ] && $ data [ "TotalMatches" ] && count ( $ tracks ) < $ data [ "TotalMatches" ] ) ; return $ tracks ; }
Get tracks from the queue.

@param int $start The zero-based position in the queue to start from
@param int $total The maximum number of tracks to return

@return TrackInterface[]
Get tracks from the queue .