Adds check for already added agents in a aplatform

main
Yasen Pramatarov 2024-10-26 15:19:45 +03:00
parent 9bfb79d036
commit be8f008eb4
1 changed files with 16 additions and 0 deletions

View File

@ -77,6 +77,22 @@ class Agent {
return $query->fetchAll(PDO::FETCH_ASSOC); return $query->fetchAll(PDO::FETCH_ASSOC);
} }
// get agent types already configured for a platform
public function getPlatformAgentTypes($platform_id) {
$sql = 'SELECT
id,
agent_type_id
FROM
jilo_agents
WHERE
platform_id = :platform_id';
$query - $this->db->prepare($sql);
$query->bindParam(':platform_id', $platform_id);
$query->execute();
return $query->fetchAll(PDO::FETCH_ASSOC);
}
// add new agent // add new agent
public function addAgent($platform_id, $newAgent) { public function addAgent($platform_id, $newAgent) {
try { try {