InvitationModel::getInvitationCode PHP Method

getInvitationCode() protected method

Returns a unique 8 character invitation code.
protected getInvitationCode ( )
    protected function getInvitationCode()
    {
        // Generate a new invitation code.
        $Code = BetterRandomString(16, 'Aa0');
        // Make sure the string doesn't already exist in the invitation table
        $CodeData = $this->getWhere(array('Code' => $Code));
        if ($CodeData->numRows() > 0) {
            return $this->GetInvitationCode();
        } else {
            return $Code;
        }
    }