Ryzom Account Management System  1.0
Public Member Functions | Static Public Member Functions | Private Attributes
Assigned Class Reference

Handles the assigning of a ticket to a user. More...

Public Member Functions

 __construct ()
 A constructor.
 set ($values)
 sets the object's attributes.
 create ()
 creates a new 'assigned' entry.
 delete ()
 deletes an existing 'assigned' entry.
 load ($ticket_id)
 loads the object's attributes.
 getUser ()
 get user attribute of the object.
 getTicket ()
 get ticket attribute of the object.
 setUser ($u)
 set user attribute of the object.
 setTicket ($t)
 set ticket attribute of the object.

Static Public Member Functions

static assignTicket ($user_id, $ticket_id)
 Assigns a ticket to a user or returns an error message.
static unAssignTicket ($user_id, $ticket_id)
 Unassign a ticket being coupled to a user or return an error message.
static getUserAssignedToTicket ($ticket_id)
 Get the (external) id of the user assigned to a ticket.
static isAssigned ($ticket_id, $user_id=0)
 Check if a ticket is already assigned (in case the user_id param is used, it will check if it's assigned to that user)

Private Attributes

 $user
 The id of the user being assigned.
 $ticket
 The id of the ticket being assigned.

Detailed Description

Handles the assigning of a ticket to a user.

This is being used to make someone responsible for the handling and solving of a ticket. The idea is that someone can easily assign a ticket to himself and by doing that, he makes aware to the other moderators that he will deal with the ticket in the future.

Author:
Daan Janssens, mentored by Matthew Lagoe

Constructor & Destructor Documentation

A constructor.

Empty constructor


Member Function Documentation

static assignTicket ( user_id,
ticket_id 
) [static]

Assigns a ticket to a user or returns an error message.

It will first check if the ticket isn't already assigned, if not, it will create a new 'assigned' entry.

Parameters:
$user_idthe id of the user we want to assign to the ticket
$ticket_idthe id of the ticket.
Returns:
A string, if assigning succeedded "SUCCESS_ASSIGNED" will be returned, else "ALREADY_ASSIGNED" will be returned.
create ( )

creates a new 'assigned' entry.

this method will use the object's attributes for creating a new 'assigned' entry in the database.

delete ( )

deletes an existing 'assigned' entry.

this method will use the object's attributes for deleting an existing 'assigned' entry in the database.

getTicket ( )

get ticket attribute of the object.

getUser ( )

get user attribute of the object.

static getUserAssignedToTicket ( ticket_id) [static]

Get the (external) id of the user assigned to a ticket.

Parameters:
$ticket_idthe Id of the ticket that's being queried
Returns:
The (external)id of the user being assigned to the ticket
static isAssigned ( ticket_id,
user_id = 0 
) [static]

Check if a ticket is already assigned (in case the user_id param is used, it will check if it's assigned to that user)

Parameters:
$ticket_idthe Id of the ticket that's being queried
$user_idthe id of the user, default parameter = 0, by using a user_id, it will check if that user is assigned to the ticket.
Returns:
true in case it's assigned, false in case it isn't.
load ( ticket_id)

loads the object's attributes.

loads the object's attributes by giving a ticket_id, it will put the matching user_id and the ticket_id into the attributes.

Parameters:
$ticket_idthe id of the ticket that should be loaded
set ( values)

sets the object's attributes.

Parameters:
$valuesshould be an array of the form array('User' => user_id, 'Ticket' => ticket_id).
setTicket ( t)

set ticket attribute of the object.

Parameters:
$tinteger id of the ticket
setUser ( u)

set user attribute of the object.

Parameters:
$uinteger id of the user
static unAssignTicket ( user_id,
ticket_id 
) [static]

Unassign a ticket being coupled to a user or return an error message.

It will first check if the ticket is assigned, if this is indeed the case it will delete the 'assigned' entry.

Parameters:
$user_idthe id of the user we want to unassign from the ticket
$ticket_idthe id of the ticket.
Returns:
A string, if unassigning succeedded "SUCCESS_UNASSIGNED" will be returned, else "NOT_ASSIGNED" will be returned.

Field Documentation

$ticket [private]

The id of the ticket being assigned.

$user [private]

The id of the user being assigned.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables