function updateURLS() { $presentations = dataobject::get('VideoPresentation', 'PresentationCategoryPageID = ' . $this->ID, 'StartTime ASC'); foreach ($presentations as $presentation) { if ($presentation->URLSegment == null) { $presentation->write(); } } echo "Presentation URLS updated."; }