public function getUnPublishedTracks() { $tracks = $this->tracks->toArray(); return array_filter($tracks, function ($track) { return $track->getEvent() ? 0 : 1; }); }
/** * Removes a track from the playlist. * * @param Track $track The track to remove from the playlist. * @return void */ public function removeTrack(Track $track) { $this->tracks->remove($track->getId()); }