/** An internal array of ID => optionTxt
*/
- protected $options;
+ protected $options = null;
/** Description of the MySQL storage of the fields
*/
protected $ac_distinct = true; // Whether we want to keep only distinct valfield value
protected $ac_withid = true; // Do we want to fetch id too ?
- public function __construct() {
- $this->loadOptions();
+ protected function _fetchOptions()
+ {
+ if (is_null($this->options)) {
+ $this->loadOptions();
+ }
}
public function getOptions()
{
+ $this->_fetchOptions();
return $this->options;
}
public function getOptions($eduid = null)
{
+ $this->_fetchOptions();
if ($eduid == null) {
return PlIteratorUtils::fromArray($this->options, 1, true);
}
public function getOptions($country = null)
{
+ $this->_fetchOptions();
+
if ($country == null) {
return PlIteratorUtils::fromArray($this->options, 1, true);
}