public function nsdrPopulate($tthis, $context, $data) { $ret = ''; if (preg_match('/^com\\.clearhealth\\.enumerations\\.(.*)$/', $this->_alias, $matches)) { $name = $matches[1]; $enumeration = new self(); $enumeration->populateByFilter('key', $name); $enumerationsClosure = new EnumerationsClosure(); $enumerationIterator = $enumerationsClosure->getAllDescendants($enumeration->enumerationId, 1); $data = array(); foreach ($enumerationIterator as $enum) { if ($this->_context != '*' && $this->_context == $enum->key) { $data = $enum->toArray(); break; } $data[] = $enum->toArray(); } $ret = $data; } return $ret; }