src/snac/server/database/SQL.php
/**
     * Read Analytics by Repository
     *
     * Read outbound link traffic analytics by holding repository
     *
     * @param string $icid The id of the holding repository
     * @return array $results Array of dates and hit counts
     */
Read Analytics by Repository
Read outbound link traffic analytics by holding repository

@param string $icid The id of the holding repository
@return array $results Array of dates and hit counts
Read Analytics by Repository Read outbound link traffic analytics by holding repository @param string $icid The id of the holding repository @return array $results Array of dates and hit counts
public function selectAnalyticsByRepo($icid) {
        $sql = "SELECT count(*), to_char(timestamp, 'yyyy-mm') AS date
                FROM outbound_link o
                LEFT JOIN constellation_lookup c
                    ON o.repo_ic_id = c.ic_id
                WHERE repo_ic_id IN
                    (SELECT ic_id
                    FROM constellation_lookup
                    WHERE current_ic_id = $1)
                AND timestamp > (NOW() - INTERVAL '1 year')
                GROUP BY date;";
        $result = $this->sdb->query($sql, [$icid]);
        $results = $this->sdb->fetchAll($result);
        return $results;
    }
public function selectAnalyticsByRepo ( $ icid ) { $ sql = " SELECT count(*), to_char(timestamp, 'yyyy-mm') AS date
                FROM outbound_link o
                LEFT JOIN constellation_lookup c
                    ON o.repo_ic_id = c.ic_id
                WHERE repo_ic_id IN
                    (SELECT ic_id
                    FROM constellation_lookup
                    WHERE current_ic_id = $1)
                AND timestamp > (NOW() - INTERVAL '1 year')
                GROUP BY date; " ; $ result = $ this -> sdb -> query ( $ sql , [ $ icid ] ) ; $ results = $ this -> sdb -> fetchAll ( $ result ) ; return $ results ; }
Read Analytics by Repository
 Read outbound link traffic analytics by holding repository
Read Analytics by Repository Read outbound link traffic analytics by holding repository