ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilDclIliasReferenceRecordFieldModel.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 require_once './Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordFieldModel.php';
6 require_once './Services/Object/classes/class.ilObject2.php';
7 
8 
21 {
22 
26  protected $dcl_obj_id;
27 
29  {
30  parent::__construct($record, $field);
31 
32  $dclTable = ilDclCache::getTableCache($this->getField()->getTableId());
33  $this->dcl_obj_id = $dclTable->getCollectionObject()->getId();
34  }
35 
36  public function getStatus()
37  {
38  global $DIC;
39  $ilDB = $DIC['ilDB'];
40  $ilUser = $DIC['ilUser'];
41  $usr_id = $ilUser->getId();
42  $obj_ref = $this->getValue();
43  $obj_id = ilObject2::_lookupObjectId($obj_ref);
44  $query = " SELECT status_changed, status
45  FROM ut_lp_marks
46  WHERE usr_id = " . $usr_id . " AND obj_id = " . $obj_id;
47  $result = $ilDB->query($query);
48  return ($result->numRows() == 0)? false : $result->fetchRow(ilDBConstants::FETCHMODE_OBJECT);
49  }
50 
51 
55  public function getValueForRepresentation()
56  {
57  $ref_id = $this->getValue();
58  return ilObject2::_lookupTitle(ilObject2::_lookupObjectId($ref_id)) . ' [' . $ref_id . ']';
59  }
60 
61 
65  public function getExportValue()
66  {
67  $link = ilLink::_getStaticLink($this->getValue());
68  return $link;
69  }
70 }
Class ilDclBaseFieldModel.
static _lookupTitle($a_id)
$result
global $DIC
Definition: saml.php:7
static _lookupObjectId($a_ref_id)
static getTableCache($table_id=0)
$ilUser
Definition: imgupload.php:18
$query
Class ilDclBaseRecordModel.
global $ilDB
__construct(ilDclBaseRecordModel $record, ilDclBaseFieldModel $field)