namespace Combodo\iTop\Form\Field; use \Combodo\iTop\Form\Field\Field; /** * Description of LinkedSetField * * @author Guillaume Lajarige */ class LinkedSetField extends Field { protected $sTargetClass; protected $sExtKeyToRemote; protected $bIndirect; protected $aAttributesToDisplay; protected $sSearchEndpoint; protected $sInformationEndpoint; public function __construct($sId, \Closure $onFinalizeCallback = null) { $this->sTargetClass = null; $this->sExtKeyToRemote = null; $this->bIndirect = false; $this->aAttributesToDisplay = array(); $this->sSearchEndpoint = null; $this->sInformationEndpoint = null; parent::__construct($sId, $onFinalizeCallback); } /** * * @return string */ public function GetTargetClass() { return $this->sTargetClass; } /** * * @param string $sTargetClass * @return \Combodo\iTop\Form\Field\LinkedSetField */ public function SetTargetClass($sTargetClass) { $this->sTargetClass = $sTargetClass; return $sTargetClass; } /** * * @return string */ public function GetExtKeyToRemote() { return $this->sExtKeyToRemote; } /** * * @param string $sExtKeyToRemote * @return \Combodo\iTop\Form\Field\LinkedSetField */ public function SetExtKeyToRemote($sExtKeyToRemote) { $this->sExtKeyToRemote = $sExtKeyToRemote; return $sExtKeyToRemote; } /** * * @return boolean */ public function IsIndirect() { return $this->bIndirect; } /** * * @param boolean $bIndirect * @return \Combodo\iTop\Form\Field\LinkedSetField */ public function SetIndirect($bIndirect) { $this->bIndirect = $bIndirect; return $this; } /** * Returns a hash array of attributes to be displayed in the linkedset in the form $sAttCode => $sAttLabel * * @param $bAttCodesOnly If set to true, will return only the attcodes * @return array */ public function GetAttributesToDisplay($bAttCodesOnly = false) { return ($bAttCodesOnly) ? array_keys($this->aAttributesToDisplay) : $this->aAttributesToDisplay; } /** * * @param array $aAttCodes * @return \Combodo\iTop\Form\Field\LinkedSetField */ public function SetAttributesToDisplay(array $aAttributesToDisplay) { $this->aAttributesToDisplay = $aAttributesToDisplay; return $this; } public function GetSearchEndpoint() { return $this->sSearchEndpoint; } public function SetSearchEndpoint($sSearchEndpoint) { $this->sSearchEndpoint = $sSearchEndpoint; return $this; } public function GetInformationEndpoint() { return $this->sInformationEndpoint; } public function SetInformationEndpoint($sInformationEndpoint) { $this->sInformationEndpoint = $sInformationEndpoint; return $this; } }