pdo = $pdo; } public function create($name, $description, $projectId, $userId, $status = 'created') { $stmt = $this->pdo->prepare("INSERT INTO tasks (name, description, project_id, user_id, status) VALUES (?, ?, ?, ?, ?)"); $stmt->execute([$name, $description, $projectId, $userId, $status]); return $this->pdo->lastInsertId(); } public function getProjectTasks($projectId) { $stmt = $this->pdo->prepare("SELECT * FROM tasks WHERE project_id = ? ORDER BY created_at DESC"); $stmt->execute([$projectId]); return $stmt->fetchAll(); } public function updateTaskStatus($taskId, $status) { $stmt = $this->pdo->prepare("UPDATE tasks SET status = ? WHERE id = ?"); return $stmt->execute([$status, $taskId]); } }