protected function createMediaIfNotExists($name) { if (!array_key_exists($name, $this->medias)) { $this->medias[$name] = []; } }