Kimai_Database_Mysql::project_get_activityIDs PHP Method

project_get_activityIDs() public method

returns all the activity ids which were assigned to a project
Author: sl
public project_get_activityIDs ( integer $projectID ) : array
$projectID integer ID of the project
return array contains the activityIDs of the activities or false on error
    public function project_get_activityIDs($projectID)
    {
        $projectId = MySQL::SQLValue($projectID, MySQL::SQLVALUE_NUMBER);
        $p = $this->kga['server_prefix'];
        $query = "SELECT activityID\n                FROM {$p}projects_activities AS p_a\n                JOIN {$p}activities AS activity USING(activityID)\n                WHERE projectID = {$projectId} AND activity.trash=0;";
        $result = $this->conn->Query($query);
        if ($result == false) {
            $this->logLastError('project_get_activityIDs');
            return false;
        }
        $rows = $this->conn->RecordsArray(MYSQLI_ASSOC);
        $activityIDs = array();
        if ($this->conn->RowCount()) {
            foreach ($rows as $row) {
                $activityIDs[$row['activityID']] = $row['activityID'];
            }
        }
        return $activityIDs;
    }
Kimai_Database_Mysql