/** * * @param array $items */ public function add($items) { $this->objects_imported = 0; $this->objects_skipped = 0; foreach ($items as $item) { $title = $item->title; $description = $item->description; if (empty($title) || empty($description)) { $this->objects_skipped++; continue; } $item->c_id = $this->course->c_id; $item->session_id = $this->course->session_id; $repo = Notebook::repository(); $success = $repo->save($item); if ($success) { $this->objects_imported++; } else { $this->objects_skipped++; } } }