public function getType() { if ($this->videoUrl) { return 'video'; } elseif ($this->image) { return 'image'; } return; }