* @package taoOutcomeUi */ abstract class VariableColumn extends tao_models_classes_table_Column { // --- ATTRIBUTES --- /** * Identifier of the variable * * @var string */ public $identifier = ''; /** * The identifier of the context usually correpsonds to the item URI * * @var string */ public $contextIdentifier = ''; /** * The label of the context usually coresponds to the item label * * @var string */ public $contextLabel = ''; /** * shared data providider to cache the variables * * @var VariableDataProvider */ public $dataProvider = null; /** * @var string */ private $columnType; // --- OPERATIONS --- /** * * @param array $array * @return \oat\taoOutcomeUi\model\table\VariableColumn */ protected static function fromArray($array) { $returnValue = null; $contextId = $array['contextId']; $contextLabel = $array['contextLabel']; $variableIdentifier = $array['variableIdentifier']; $columnType = $array['columnType']; $returnValue = new static($contextId, $contextLabel, $variableIdentifier, $columnType); return $returnValue; } /** * * @param string $contextIdentifier * @param string $contextLabel * @param string $identifier * @param string|null $columnType */ public function __construct($contextIdentifier, $contextLabel, $identifier, $columnType = null) { parent::__construct($contextLabel . "-" . $identifier); $this->identifier = $identifier; $this->contextIdentifier = $contextIdentifier; $this->contextLabel = $contextLabel; $this->columnType = $columnType; } public function getColumnType() { return $this->columnType; } public function setDataProvider(VariableDataProvider $provider) { $this->dataProvider = $provider; } /** * Short description of method getDataProvider * * @access public * @author Joel Bout, * @return tao_models_classes_table_DataProvider */ public function getDataProvider() { return $this->dataProvider; } /** * Short description of method getContextIdentifier * * @access public * @author Joel Bout, * @return core_kernel_classes_Resource */ public function getContextIdentifier() { return $this->contextIdentifier; } /** * Short description of method getIdentifier * * @access public * @author Joel Bout, * @return string */ public function getIdentifier() { return $this->identifier; } /** * Short description of method toArray * * @access public * @author Joel Bout, * @return array */ public function toArray() { $returnValue = parent::toArray(); //$returnValue['ca'] = "deprecated"; $returnValue['contextId'] = $this->contextIdentifier; $returnValue['contextLabel'] = $this->contextLabel; $returnValue['variableIdentifier'] = $this->identifier; $returnValue['columnType'] = $this->getColumnType(); return (array) $returnValue; } /** * Returns the variable type of the column * * @return string */ abstract public function getVariableType(); }