UserModel::getSystemUserID PHP Method

getSystemUserID() public method

Retrieves a "system user" id that can be used to perform non-real-person tasks.
public getSystemUserID ( ) : integer
return integer Returns a user ID.
    public function getSystemUserID()
    {
        $SystemUserID = c('Garden.SystemUserID');
        if ($SystemUserID) {
            return $SystemUserID;
        }
        $SystemUser = ['Name' => t('System'), 'Photo' => asset('/applications/dashboard/design/images/usericon.png', true), 'Password' => randomString('20'), 'HashMethod' => 'Random', 'Email' => '[email protected]', 'DateInserted' => Gdn_Format::toDateTime(), 'Admin' => '2'];
        $this->EventArguments['SystemUser'] =& $SystemUser;
        $this->fireEvent('BeforeSystemUser');
        $SystemUserID = $this->SQL->insert($this->Name, $SystemUser);
        saveToConfig('Garden.SystemUserID', $SystemUserID);
        return $SystemUserID;
    }
UserModel