ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCertificateMigration Class Reference

Class ilCertificateMigration. More...

+ Collaboration diagram for ilCertificateMigration:

Public Member Functions

 __construct (int $user_id, \ilDBInterface $db=null)
 ilCertificateMigration constructor. More...
 
 getTaskInformations ()
 
 getTaskInformationObject ()
 
 getProgressedItemsAsPercent ()
 
 isTaskStarted ()
 
 isTaskRunning ()
 
 isTaskFailed ()
 
 isTaskFinished ()
 

Protected Attributes

 $user_id
 
 $information_object
 
 $db
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCertificateMigration::__construct ( int  $user_id,
\ilDBInterface  $db = null 
)

ilCertificateMigration constructor.

Parameters
int$user_id
\ilDBInterface$db

Definition at line 44 of file class.ilCertificateMigration.php.

References $db, $DIC, $user_id, and getTaskInformations().

45  {
46  global $DIC;
47 
48  $this->user_id = $user_id;
49  if (null === $db) {
50  $db = $DIC->database();
51  }
52  $this->db = $db;
53  $this->information_object = new \ilCertificateMigrationInformationObject(
54  $this->getTaskInformations()
55  );
56  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:

Member Function Documentation

◆ getProgressedItemsAsPercent()

ilCertificateMigration::getProgressedItemsAsPercent ( )
Returns
float

Definition at line 86 of file class.ilCertificateMigration.php.

86  : float
87  {
88  return (float) (100 / $this->information_object->getFoundItems() * $this->information_object->getProgressedItems());
89  }

◆ getTaskInformationObject()

ilCertificateMigration::getTaskInformationObject ( )

◆ getTaskInformations()

ilCertificateMigration::getTaskInformations ( )
Returns
array

Definition at line 61 of file class.ilCertificateMigration.php.

References $data, and $result.

Referenced by __construct().

61  : array
62  {
63  $result = $this->db->queryF(
64  'SELECT * FROM il_cert_bgtask_migr WHERE usr_id = %s',
65  ['integer'],
66  [$this->user_id]
67  );
68  if ($result->numRows() == 1) {
69  $data = $this->db->fetchAssoc($result);
70  return $data;
71  }
72  return [];
73  }
$result
$data
Definition: bench.php:6
+ Here is the caller graph for this function:

◆ isTaskFailed()

ilCertificateMigration::isTaskFailed ( )
Returns
bool

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

References ilCertificateMigrationJobDefinitions\CERT_MIGRATION_STATE_FAILED, and ilCertificateMigrationJobDefinitions\CERT_MIGRATION_STATE_STOPPED.

113  : bool
114  {
115  return (
116  $this->information_object->getState() === \ilCertificateMigrationJobDefinitions::CERT_MIGRATION_STATE_FAILED ||
117  $this->information_object->getState() === \ilCertificateMigrationJobDefinitions::CERT_MIGRATION_STATE_STOPPED ||
118  (
119  $this->information_object->getFinishedTime() === 0 &&
120  $this->information_object->getStartingTime() !== 0 &&
121  strtotime('-1 hours') > $this->information_object->getStartingTime()
122  )
123  );
124  }

◆ isTaskFinished()

ilCertificateMigration::isTaskFinished ( )
Returns
bool

Definition at line 129 of file class.ilCertificateMigration.php.

References ilCertificateMigrationJobDefinitions\CERT_MIGRATION_STATE_FINISHED.

Referenced by ilCertificateMigrationValidator\isMigrationAvailable().

129  : bool
130  {
131  return $this->information_object->getState() === \ilCertificateMigrationJobDefinitions::CERT_MIGRATION_STATE_FINISHED;
132  }
+ Here is the caller graph for this function:

◆ isTaskRunning()

ilCertificateMigration::isTaskRunning ( )
Returns
bool

Definition at line 102 of file class.ilCertificateMigration.php.

References ilCertificateMigrationJobDefinitions\CERT_MIGRATION_STATE_RUNNING.

Referenced by ilCertificateMigrationValidator\isMigrationAvailable().

102  : bool
103  {
104  return (
105  $this->information_object->getLock() &&
106  $this->information_object->getState() === \ilCertificateMigrationJobDefinitions::CERT_MIGRATION_STATE_RUNNING
107  );
108  }
+ Here is the caller graph for this function:

◆ isTaskStarted()

ilCertificateMigration::isTaskStarted ( )
Returns
bool

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

References ilCertificateMigrationJobDefinitions\CERT_MIGRATION_STATE_INIT.

94  : bool
95  {
96  return $this->information_object->getState() === \ilCertificateMigrationJobDefinitions::CERT_MIGRATION_STATE_INIT;
97  }

Field Documentation

◆ $db

ilCertificateMigration::$db
protected

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

Referenced by __construct().

◆ $information_object

ilCertificateMigration::$information_object
protected

Definition at line 34 of file class.ilCertificateMigration.php.

Referenced by getTaskInformationObject().

◆ $user_id

ilCertificateMigration::$user_id
protected

Definition at line 31 of file class.ilCertificateMigration.php.

Referenced by __construct().


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