ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilExportFileInfo Class Reference

Stores information of creation date and versions of export files More...

+ Collaboration diagram for ilExportFileInfo:

Public Member Functions

 __construct ($a_obj_id, $a_export_type= '', $a_filename= '')
 Constructor.
 setExportType ($a_type)
 set export type
 getExportType ()
 get export type
 setFilename ($a_name)
 set filename
 getFilename ()
 get filename
 getBasename ($a_ext= '.zip')
 setObjId ($a_id)
 Set obj id.
 getObjId ()
 Get obj id.
 setVersion ($a_version)
 set version
 getVersion ()
 get version
 getCreationDate ()
 get creation date
 setCreationDate (ilDateTime $dt=null)
 set creation date
 create ()
 Create new export entry.
 delete ()
 Delete one export entry.

Static Public Member Functions

static lookupLastExport ($a_obj_id, $a_type, $a_version= '')
 Lookup last export.
static deleteByObjId ($a_obj_id)
 Delete all export entries by obj_id.

Data Fields

const CURRENT_VERSION = "4.1.0"

Protected Member Functions

 read ()
 Read.

Private Attributes

 $obj_id = 0
 $version = self::CURRENT_VERSION
 $export_type = ''
 $file_name = ''
 $create_date = null

Detailed Description

Stores information of creation date and versions of export files

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 13 of file class.ilExportFileInfo.php.

Constructor & Destructor Documentation

ilExportFileInfo::__construct (   $a_obj_id,
  $a_export_type = '',
  $a_filename = '' 
)

Constructor.

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

References getExportType(), getFilename(), getObjId(), and read().

{
$this->obj_id = $a_obj_id;
$this->export_type = $a_export_type;
$this->file_name = $a_filename;
if($this->getObjId() and $this->getExportType() and $this->getFilename())
{
$this->read();
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilExportFileInfo::create ( )

Create new export entry.

Returns

Definition at line 183 of file class.ilExportFileInfo.php.

References $ilDB, $query, getCreationDate(), getExportType(), getFilename(), getObjId(), getVersion(), IL_CAL_DATETIME, and ilTimeZone\UTC.

{
global $ilDB;
$query = "INSERT INTO export_file_info (obj_id, export_type, filename, version, create_date) ".
"VALUES ( ".
$ilDB->quote($this->getObjId(),'integer').', '.
$ilDB->quote($this->getExportType(),'text').', '.
$ilDB->quote($this->getFilename(),'text').', '.
$ilDB->quote($this->getVersion(),'text').', '.
$ilDB->quote($this->getCreationDate()->get(IL_CAL_DATETIME,'',ilTimeZone::UTC),'timestamp').' '.
")";
$ilDB->manipulate($query);
}

+ Here is the call graph for this function:

ilExportFileInfo::delete ( )

Delete one export entry.

Returns

Definition at line 202 of file class.ilExportFileInfo.php.

References $ilDB.

Referenced by ilExportGUI\delete().

{
global $ilDB;
$ilDB->manipulate('DELETE FROM export_file_info '.
'WHERE obj_id = '.$ilDB->quote($this->getObjId(),'integer').' '.
'AND filename = '.$ilDB->quote($this->getFilename(),'text')
);
return true;
}

+ Here is the caller graph for this function:

static ilExportFileInfo::deleteByObjId (   $a_obj_id)
static

Delete all export entries by obj_id.

Parameters
object$a_obj_id
Returns

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

References $ilDB.

{
global $ilDB;
$ilDB->manipulate("DELETE FROM export_file_info WHERE obj_id = ".$ilDB->quote($a_obj_id));
return true;
}
ilExportFileInfo::getBasename (   $a_ext = '.zip')

Definition at line 118 of file class.ilExportFileInfo.php.

References getFilename().

{
return basename($this->getFilename(),$a_ext);
}

+ Here is the call graph for this function:

ilExportFileInfo::getCreationDate ( )

get creation date

Returns
ilDateTime $date

Definition at line 164 of file class.ilExportFileInfo.php.

References IL_CAL_UNIX.

Referenced by create().

{
return $this->create_date instanceof ilDateTime ? $this->create_date : new ilDateTime(time(),IL_CAL_UNIX);
}

+ Here is the caller graph for this function:

ilExportFileInfo::getExportType ( )

get export type

Returns
string export type

Definition at line 94 of file class.ilExportFileInfo.php.

References $export_type.

Referenced by __construct(), create(), and read().

{
}

+ Here is the caller graph for this function:

ilExportFileInfo::getFilename ( )

get filename

Returns

Definition at line 113 of file class.ilExportFileInfo.php.

References $file_name.

Referenced by __construct(), create(), getBasename(), and read().

{
}

+ Here is the caller graph for this function:

ilExportFileInfo::getObjId ( )

Get obj id.

Returns

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

References $obj_id.

Referenced by __construct(), create(), and read().

{
return $this->obj_id;
}

+ Here is the caller graph for this function:

ilExportFileInfo::getVersion ( )

get version

Returns

Definition at line 155 of file class.ilExportFileInfo.php.

References $version.

Referenced by create().

{
}

+ Here is the caller graph for this function:

static ilExportFileInfo::lookupLastExport (   $a_obj_id,
  $a_type,
  $a_version = '' 
)
static

Lookup last export.

Parameters
object$a_obj_id
stringtype xml | html | scorm2004...
stringversion
Returns
object ilExportFileInfo

Definition at line 45 of file class.ilExportFileInfo.php.

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

Referenced by ilExportContainer\addSubitems(), and ilExportSelectionTableGUI\parseContainer().

{
global $ilDB;
$query = "SELECT * FROM export_file_info ".
"WHERE obj_id = ".$ilDB->quote($a_obj_id,'integer').' '.
"AND export_type = ".$ilDB->quote($a_type,'text').' '.
"ORDER BY create_date DESC";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
if(!$a_version or $row->version == $a_version)
{
return new ilExportFileInfo($row->obj_id,$row->export_type,$row->filename);
}
}
return null;
}

+ Here is the caller graph for this function:

ilExportFileInfo::read ( )
protected

Read.

Returns

Definition at line 217 of file class.ilExportFileInfo.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, getExportType(), getFilename(), getObjId(), IL_CAL_DATETIME, setCreationDate(), setVersion(), and ilTimeZone\UTC.

Referenced by __construct().

{
global $ilDB;
$query = "SELECT * FROM export_file_info ".
"WHERE obj_id = ".$ilDB->quote($this->getObjId(),'integer').' '.
"AND export_type = ".$ilDB->quote($this->getExportType(),'text').' '.
"AND filename = ".$ilDB->quote($this->getFilename(),'text');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setVersion($row->version);
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExportFileInfo::setCreationDate ( ilDateTime  $dt = null)

set creation date

Parameters
ilDateTime$dt[optional]
Returns

Definition at line 174 of file class.ilExportFileInfo.php.

Referenced by read().

{
$this->create_date = $dt;
}

+ Here is the caller graph for this function:

ilExportFileInfo::setExportType (   $a_type)

set export type

Parameters
string$a_typexml | html ...
Returns

Definition at line 85 of file class.ilExportFileInfo.php.

{
$this->export_type = $a_type;
}
ilExportFileInfo::setFilename (   $a_name)

set filename

Parameters
string$a_name
Returns

Definition at line 104 of file class.ilExportFileInfo.php.

{
$this->file_name = $a_name;
}
ilExportFileInfo::setObjId (   $a_id)

Set obj id.

Parameters
object$a_id
Returns

Definition at line 128 of file class.ilExportFileInfo.php.

{
$this->obj_id = $a_id;
}
ilExportFileInfo::setVersion (   $a_version)

set version

Returns

Definition at line 146 of file class.ilExportFileInfo.php.

Referenced by read().

{
$this->version = $a_version;
}

+ Here is the caller graph for this function:

Field Documentation

ilExportFileInfo::$create_date = null
private

Definition at line 22 of file class.ilExportFileInfo.php.

ilExportFileInfo::$export_type = ''
private

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

Referenced by getExportType().

ilExportFileInfo::$file_name = ''
private

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

Referenced by getFilename().

ilExportFileInfo::$obj_id = 0
private

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

Referenced by getObjId().

ilExportFileInfo::$version = self::CURRENT_VERSION
private

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

Referenced by getVersion().

const ilExportFileInfo::CURRENT_VERSION = "4.1.0"

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


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