Elgg\Notifications\SubscriptionsService::getSubscriptionRecords PHP Method

getSubscriptionRecords() protected method

Records are an object with two vars: guid and methods with the latter being a comma-separated list of subscription relationship names.
protected getSubscriptionRecords ( integer $container_guid ) : array
$container_guid integer The GUID of the subscription target
return array
    protected function getSubscriptionRecords($container_guid)
    {
        $container_guid = $this->db->sanitizeInt($container_guid);
        // create IN clause
        $rels = $this->getMethodRelationships();
        if (!$rels) {
            return array();
        }
        array_walk($rels, array($this->db, 'sanitizeString'));
        $methods_string = "'" . implode("','", $rels) . "'";
        $db_prefix = $this->db->prefix;
        $query = "SELECT guid_one AS guid, GROUP_CONCAT(relationship SEPARATOR ',') AS methods\n\t\t\tFROM {$db_prefix}entity_relationships\n\t\t\tWHERE guid_two = {$container_guid} AND\n\t\t\t\t\trelationship IN ({$methods_string}) GROUP BY guid_one";
        return $this->db->getData($query);
    }