ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilECSCourseMemberAssignment Class Reference

Storage of ecs course assignments. More...

+ Collaboration diagram for ilECSCourseMemberAssignment:

Public Member Functions

 __construct ($a_id=0)
 Constructor.
 getId ()
 setServer ($a_server)
 Set server.
 getServer ()
 Get server.
 setMid ($a_mid)
 getMid ()
 setCmsId ($a_id)
 getCmsId ()
 setCmsSubId ($a_id)
 getCmsSubId ()
 setObjId ($a_id)
 getObjId ()
 setUid ($a_id)
 getUid ()
 setStatus ($a_status)
 getStatus ()
 save ()
 Save new entry type $ilDB.
 update ()
 Update assignemt type $ilDB.
 delete ()
 Delete entry.

Static Public Member Functions

static deleteByObjId ($a_obj_id)
 Delete by obj_id.
static deleteByServerId ($a_server_id)
 Delete by server id type $ilDB.
static lookupUserIds ($a_cms_id, $a_cms_sub_id, $a_obj_id)
 Lookup user ids type $ilDB.
static lookupAssignment ($a_cms_id, $a_cms_sub_id, $a_obj_id, $a_usr_id)
 Lookup assignment of user type $ilDB.

Data Fields

const STATUS_ASSIGNED = 0
const STATUS_LOCAL_DELETED = 1

Protected Member Functions

 read ()
 Read from db.

Private Attributes

 $id
 $server
 $mid
 $cms_id
 $cms_sub_id = 0
 $obj_id
 $uid
 $status = 0

Detailed Description

Storage of ecs course assignments.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 9 of file class.ilECSCourseMemberAssignment.php.

Constructor & Destructor Documentation

ilECSCourseMemberAssignment::__construct (   $a_id = 0)

Constructor.

Definition at line 27 of file class.ilECSCourseMemberAssignment.php.

References read().

{
$this->id = $a_id;
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

ilECSCourseMemberAssignment::delete ( )

Delete entry.

Definition at line 248 of file class.ilECSCourseMemberAssignment.php.

References $query, and getId().

{
global $ilDB;
$query = 'DELETE FROM ecs_course_assignments '.
'WHERE id = '.$ilDB->quote($this->getId(),'integer');
$ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

static ilECSCourseMemberAssignment::deleteByObjId (   $a_obj_id)
static

Delete by obj_id.

Definition at line 37 of file class.ilECSCourseMemberAssignment.php.

References $query.

{
global $ilDB;
$query = 'DELETE FROM ecs_course_assignments '.
'WHERE obj_id = '.$ilDB->quote($a_obj_id, 'integer');
$ilDB->manipulate($query);
return true;
}
static ilECSCourseMemberAssignment::deleteByServerId (   $a_server_id)
static

Delete by server id type $ilDB.

Parameters
type$a_server_id
Returns
boolean

Definition at line 53 of file class.ilECSCourseMemberAssignment.php.

References $query.

{
global $ilDB;
$query = 'DELETE FROM ecs_course_assignments '.
'WHERE sid = '.$ilDB->quote($a_server_id, 'integer');
$ilDB->manipulate($query);
return true;
}
ilECSCourseMemberAssignment::getCmsId ( )

Definition at line 152 of file class.ilECSCourseMemberAssignment.php.

References $cms_id.

Referenced by save(), and update().

{
return $this->cms_id;
}

+ Here is the caller graph for this function:

ilECSCourseMemberAssignment::getCmsSubId ( )

Definition at line 162 of file class.ilECSCourseMemberAssignment.php.

References $cms_sub_id.

Referenced by save(), and update().

{
}

+ Here is the caller graph for this function:

ilECSCourseMemberAssignment::getId ( )

Definition at line 114 of file class.ilECSCourseMemberAssignment.php.

References $id.

Referenced by delete(), read(), save(), and update().

{
return $this->id;
}

+ Here is the caller graph for this function:

ilECSCourseMemberAssignment::getMid ( )

Definition at line 142 of file class.ilECSCourseMemberAssignment.php.

References $mid.

Referenced by save(), and update().

{
return $this->mid;
}

+ Here is the caller graph for this function:

ilECSCourseMemberAssignment::getObjId ( )

Definition at line 172 of file class.ilECSCourseMemberAssignment.php.

References $obj_id.

Referenced by save(), and update().

{
return $this->obj_id;
}

+ Here is the caller graph for this function:

ilECSCourseMemberAssignment::getServer ( )

Get server.

Returns
int

Definition at line 132 of file class.ilECSCourseMemberAssignment.php.

References $server.

Referenced by save(), and update().

{
return $this->server;
}

+ Here is the caller graph for this function:

ilECSCourseMemberAssignment::getStatus ( )

Definition at line 192 of file class.ilECSCourseMemberAssignment.php.

References $status.

Referenced by save().

{
return $this->status;
}

+ Here is the caller graph for this function:

ilECSCourseMemberAssignment::getUid ( )

Definition at line 182 of file class.ilECSCourseMemberAssignment.php.

References $uid.

Referenced by save(), and update().

{
return $this->uid;
}

+ Here is the caller graph for this function:

static ilECSCourseMemberAssignment::lookupAssignment (   $a_cms_id,
  $a_cms_sub_id,
  $a_obj_id,
  $a_usr_id 
)
static

Lookup assignment of user type $ilDB.

Parameters
type$a_cms_id
type$a_obj_id
type$a_usr_id
Returns
|null

Definition at line 96 of file class.ilECSCourseMemberAssignment.php.

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilECSCmsCourseMemberCommandQueueHandler\refreshAssignmentStatus().

{
global $ilDB;
$query = 'SELECT id FROM ecs_course_assignments '.
'WHERE cms_id = '.$ilDB->quote($a_cms_id,'integer').' '.
'AND cms_sub_id = '.$ilDB->quote($a_cms_sub_id,'integer').' '.
'AND obj_id = '.$ilDB->quote($a_obj_id,'integer').' '.
'AND usr_id = '.$ilDB->quote($a_usr_id,'text');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
}
return null;
}

+ Here is the caller graph for this function:

static ilECSCourseMemberAssignment::lookupUserIds (   $a_cms_id,
  $a_cms_sub_id,
  $a_obj_id 
)
static

Lookup user ids type $ilDB.

Parameters
type$a_cms_id
type$a_obj_id
Returns
type

Definition at line 70 of file class.ilECSCourseMemberAssignment.php.

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilECSCmsCourseMemberCommandQueueHandler\refreshAssignmentStatus().

{
global $ilDB;
$query = 'SELECT usr_id FROM ecs_course_assignments '.
'WHERE cms_id = '.$ilDB->quote($a_cms_id,'integer').' '.
'AND cms_sub_id = '.$ilDB->quote($a_cms_sub_id).' '.
'AND obj_id = '.$ilDB->quote($a_obj_id,'integer');
$res = $ilDB->query($query);
$usr_ids = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$usr_ids[] = $row->usr_id;
}
return $usr_ids;
}

+ Here is the caller graph for this function:

ilECSCourseMemberAssignment::read ( )
protected

Read from db.

Returns
bool

Definition at line 264 of file class.ilECSCourseMemberAssignment.php.

References $query, $res, $row, DB_FETCHMODE_OBJECT, getId(), setCmsId(), setCmsSubId(), setMid(), setObjId(), setServer(), and setStatus().

Referenced by __construct().

{
global $ilDB;
if(!$this->getId())
{
return false;
}
$query = 'SELECT * FROM ecs_course_assignments '.
'WHERE id = '.$ilDB->quote($this->getId(),'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setServer($row->sid);
$this->setMid($row->mid);
$this->setCmsId($row->cms_id);
$this->setCmsSubId($row->cms_sub_id);
$this->setObjId($row->obj_id);
$this->uid = $row->uid;
$this->setStatus($row->status);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilECSCourseMemberAssignment::save ( )

Save new entry type $ilDB.

Definition at line 201 of file class.ilECSCourseMemberAssignment.php.

References $query, getCmsId(), getCmsSubId(), getId(), getMid(), getObjId(), getServer(), getStatus(), and getUid().

{
global $ilDB;
$this->id = $ilDB->nextId('ecs_course_assignments');
$query = 'INSERT INTO ecs_course_assignments '.
'(id,sid,mid,cms_id,cms_sub_id,obj_id,usr_id,status) '.
'VALUES( '.
$ilDB->quote($this->getId(),'integer').', '.
$ilDB->quote($this->getServer(),'integer').', '.
$ilDB->quote($this->getMid(),'integer').', '.
$ilDB->quote($this->getCmsId(),'integer').', '.
$ilDB->quote($this->getCmsSubId(),'integer').', '.
$ilDB->quote($this->getObjId(),'integer').', '.
$ilDB->quote($this->getUid(),'text').', '.
$ilDB->quote($this->getStatus(),'integer').' '.
')';
$ilDB->manipulate($query);
}

+ Here is the call graph for this function:

ilECSCourseMemberAssignment::setCmsId (   $a_id)

Definition at line 147 of file class.ilECSCourseMemberAssignment.php.

Referenced by read().

{
$this->cms_id = $a_id;
}

+ Here is the caller graph for this function:

ilECSCourseMemberAssignment::setCmsSubId (   $a_id)

Definition at line 157 of file class.ilECSCourseMemberAssignment.php.

Referenced by read().

{
$this->cms_sub_id = $a_id;
}

+ Here is the caller graph for this function:

ilECSCourseMemberAssignment::setMid (   $a_mid)

Definition at line 137 of file class.ilECSCourseMemberAssignment.php.

Referenced by read().

{
$this->mid = $a_mid;
}

+ Here is the caller graph for this function:

ilECSCourseMemberAssignment::setObjId (   $a_id)

Definition at line 167 of file class.ilECSCourseMemberAssignment.php.

Referenced by read().

{
$this->obj_id = $a_id;
}

+ Here is the caller graph for this function:

ilECSCourseMemberAssignment::setServer (   $a_server)

Set server.

Parameters
intserver_id

Definition at line 123 of file class.ilECSCourseMemberAssignment.php.

Referenced by read().

{
$this->server = $a_server;
}

+ Here is the caller graph for this function:

ilECSCourseMemberAssignment::setStatus (   $a_status)

Definition at line 187 of file class.ilECSCourseMemberAssignment.php.

Referenced by read().

{
$this->status = $a_status;
}

+ Here is the caller graph for this function:

ilECSCourseMemberAssignment::setUid (   $a_id)

Definition at line 177 of file class.ilECSCourseMemberAssignment.php.

{
$this->uid = $a_id;
}
ilECSCourseMemberAssignment::update ( )

Update assignemt type $ilDB.

Returns
boolean

Definition at line 227 of file class.ilECSCourseMemberAssignment.php.

References $query, getCmsId(), getCmsSubId(), getId(), getMid(), getObjId(), getServer(), and getUid().

{
global $ilDB;
$query = 'UPDATE ecs_course_assignments '.
'SET '.
'sid = '.$ilDB->quote($this->getServer(),'integer').', '.
'mid = '.$ilDB->quote($this->getMid(),'integer').', '.
'cms_id = '.$ilDB->quote($this->getCmsId(),'integer').', '.
'cms_sub_id = '.$ilDB->quote($this->getCmsSubId(),'integer').' '.
'obj_id = '.$ilDB->quote($this->getObjId(),'integer').', '.
'usr_id = '.$ilDB->quote($this->getUid(),'text').', '.
'status = '.$ilDB->quote($this->get,'integer').' '.
'WHERE id = '.$ilDB->quote($this->getId(),'integer');
$ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

Field Documentation

ilECSCourseMemberAssignment::$cms_id
private

Definition at line 17 of file class.ilECSCourseMemberAssignment.php.

Referenced by getCmsId().

ilECSCourseMemberAssignment::$cms_sub_id = 0
private

Definition at line 18 of file class.ilECSCourseMemberAssignment.php.

Referenced by getCmsSubId().

ilECSCourseMemberAssignment::$id
private

Definition at line 14 of file class.ilECSCourseMemberAssignment.php.

Referenced by getId().

ilECSCourseMemberAssignment::$mid
private

Definition at line 16 of file class.ilECSCourseMemberAssignment.php.

Referenced by getMid().

ilECSCourseMemberAssignment::$obj_id
private

Definition at line 19 of file class.ilECSCourseMemberAssignment.php.

Referenced by getObjId().

ilECSCourseMemberAssignment::$server
private

Definition at line 15 of file class.ilECSCourseMemberAssignment.php.

Referenced by getServer().

ilECSCourseMemberAssignment::$status = 0
private

Definition at line 21 of file class.ilECSCourseMemberAssignment.php.

Referenced by getStatus().

ilECSCourseMemberAssignment::$uid
private

Definition at line 20 of file class.ilECSCourseMemberAssignment.php.

Referenced by getUid().

const ilECSCourseMemberAssignment::STATUS_ASSIGNED = 0

Definition at line 11 of file class.ilECSCourseMemberAssignment.php.

const ilECSCourseMemberAssignment::STATUS_LOCAL_DELETED = 1

Definition at line 12 of file class.ilECSCourseMemberAssignment.php.


The documentation for this class was generated from the following file: