ActivityModel::getByUser PHP Method

getByUser() public method

Events: BeforeGet, AfterGet.
public getByUser ( integer | boolean $NotifyUserID = false, integer $Offset, integer $Limit = 30 ) : Gdn_DataSet
$NotifyUserID integer | boolean Unique ID of user to gather activity for or one of the NOTIFY_* constants in this class.
$Offset integer Number to skip.
$Limit integer How many to return.
return Gdn_DataSet SQL results.
    public function getByUser($NotifyUserID = false, $Offset = 0, $Limit = 30)
    {
        $Offset = is_numeric($Offset) ? $Offset : 0;
        if ($Offset < 0) {
            $Offset = 0;
        }
        $Limit = is_numeric($Limit) ? $Limit : 0;
        if ($Limit < 0) {
            $Limit = 30;
        }
        $this->activityQuery(false);
        if ($NotifyUserID === false || $NotifyUserID === 0) {
            $NotifyUserID = self::NOTIFY_PUBLIC;
        }
        $this->SQL->whereIn('NotifyUserID', (array) $NotifyUserID);
        $this->fireEvent('BeforeGet');
        $Result = $this->SQL->orderBy('a.ActivityID', 'desc')->limit($Limit, $Offset)->get();
        Gdn::userModel()->joinUsers($Result, ['ActivityUserID', 'RegardingUserID'], ['Join' => ['Name', 'Photo', 'Email', 'Gender']]);
        $this->EventArguments['Data'] =& $Result;
        $this->fireEvent('AfterGet');
        return $Result;
    }