mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-23 13:59:29 +00:00
Updated term to better meaning
This commit is contained in:
parent
4d6ada1523
commit
bae155873a
@ -211,7 +211,7 @@ class CallsController {
|
|||||||
"userID" => $member->get_userID(),
|
"userID" => $member->get_userID(),
|
||||||
"call_id" => $member->get_call_id(),
|
"call_id" => $member->get_call_id(),
|
||||||
"user_call_id" => $member->get_user_call_id(),
|
"user_call_id" => $member->get_user_call_id(),
|
||||||
"accepted" => self::USER_RESPONSE_TO_CALL[$member->get_accepted()]
|
"status" => self::USER_RESPONSE_TO_CALL[$member->get_status()]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -134,7 +134,7 @@ class CallsComponents {
|
|||||||
//Get the ID of a call the user has not responded yet
|
//Get the ID of a call the user has not responded yet
|
||||||
$entries = db()->select(
|
$entries = db()->select(
|
||||||
self::CALLS_MEMBERS_TABLE,
|
self::CALLS_MEMBERS_TABLE,
|
||||||
"WHERE user_id = ? AND user_accepted = ?",
|
"WHERE user_id = ? AND status = ?",
|
||||||
array($userID, CallMemberInformation::USER_UNKNOWN),
|
array($userID, CallMemberInformation::USER_UNKNOWN),
|
||||||
array("call_id")
|
array("call_id")
|
||||||
);
|
);
|
||||||
@ -181,7 +181,7 @@ class CallsComponents {
|
|||||||
$member->set_call_id($info->get_id());
|
$member->set_call_id($info->get_id());
|
||||||
$member->set_userID($memberID);
|
$member->set_userID($memberID);
|
||||||
$member->set_user_call_id(random_str(190));
|
$member->set_user_call_id(random_str(190));
|
||||||
$member->set_accepted(CallMemberInformation::USER_UNKNOWN);
|
$member->set_status(CallMemberInformation::USER_UNKNOWN);
|
||||||
|
|
||||||
//Try to add the member to the list
|
//Try to add the member to the list
|
||||||
if(!$this->addMember($member))
|
if(!$this->addMember($member))
|
||||||
@ -235,7 +235,7 @@ class CallsComponents {
|
|||||||
|
|
||||||
return db()->count(
|
return db()->count(
|
||||||
self::CALLS_MEMBERS_TABLE,
|
self::CALLS_MEMBERS_TABLE,
|
||||||
"WHERE user_id = ? AND user_accepted = ?",
|
"WHERE user_id = ? AND status = ?",
|
||||||
array($userID, CallMemberInformation::USER_UNKNOWN)
|
array($userID, CallMemberInformation::USER_UNKNOWN)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -293,7 +293,7 @@ class CallsComponents {
|
|||||||
self::CALLS_MEMBERS_TABLE,
|
self::CALLS_MEMBERS_TABLE,
|
||||||
"call_id = ? AND user_id = ?",
|
"call_id = ? AND user_id = ?",
|
||||||
array(
|
array(
|
||||||
"user_accepted" => $status
|
"status" => $status
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
$callID,
|
$callID,
|
||||||
@ -343,7 +343,7 @@ class CallsComponents {
|
|||||||
$member->set_call_id($entry["call_id"]);
|
$member->set_call_id($entry["call_id"]);
|
||||||
$member->set_userID($entry["user_id"]);
|
$member->set_userID($entry["user_id"]);
|
||||||
$member->set_user_call_id($entry["user_call_id"]);
|
$member->set_user_call_id($entry["user_call_id"]);
|
||||||
$member->set_accepted($entry["user_accepted"]);
|
$member->set_status($entry["status"]);
|
||||||
return $member;
|
return $member;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,7 +358,7 @@ class CallsComponents {
|
|||||||
$data["call_id"] = $member->get_call_id();
|
$data["call_id"] = $member->get_call_id();
|
||||||
$data["user_id"] = $member->get_userID();
|
$data["user_id"] = $member->get_userID();
|
||||||
$data["user_call_id"] = $member->get_user_call_id();
|
$data["user_call_id"] = $member->get_user_call_id();
|
||||||
$data["user_accepted"] = $member->get_accepted();
|
$data["status"] = $member->get_status();
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,16 +53,16 @@ class CallMemberInformation extends BaseUniqueObjectFromUser {
|
|||||||
|
|
||||||
|
|
||||||
//User response to call
|
//User response to call
|
||||||
public function set_accepted(int $accepted){
|
public function set_status(int $status){
|
||||||
$this->accepted = $accepted;
|
$this->status = $status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function has_accepted() : bool {
|
public function has_status() : bool {
|
||||||
return $this->accepted > -1;
|
return $this->status > -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_accepted() : int {
|
public function get_status() : int {
|
||||||
return $this->accepted;
|
return $this->status;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -118,7 +118,7 @@ CREATE TABLE `comunic_calls_members` (
|
|||||||
`call_id` INT NOT NULL,
|
`call_id` INT NOT NULL,
|
||||||
`user_id` INT NULL,
|
`user_id` INT NULL,
|
||||||
`user_call_id` VARCHAR(200) NULL,
|
`user_call_id` VARCHAR(200) NULL,
|
||||||
`user_accepted` TINYINT DEFAULT NULL,
|
`status` TINYINT DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user