+ /**
+ * Generate link setter/getter methods for class definition
+ *
+ * @param string Existing class contents
+ * @return string
+ * @access public
+ */
+ function _generateLinkMethods($input)
+ {
+
+ $options = &PEAR::getStaticProperty('DB_DataObject','options');
+ $setters = '';
+
+ // only generate if option is set to true
+
+ // generate_link_methods true::
+
+
+ if (empty($options['generate_link_methods'])) {
+ //echo "skip lm? - not set";
+ return '';
+ }
+
+ if (empty($this->_fkeys)) {
+ // echo "skip lm? - fkyes empty";
+ return '';
+ }
+ if (empty($this->_fkeys[$this->table])) {
+ //echo "skip lm? - no fkeys for {$this->table}";
+ return '';
+ }
+
+ // remove auto-generated code from input to be able to check if the method exists outside of the auto-code
+ $input = preg_replace('/(\n|\r\n)\s*###START_AUTOCODE(\n|\r\n).*(\n|\r\n)\s*###END_AUTOCODE(\n|\r\n)/s', '', $input);
+
+ $setters .= "\n";
+ $defs = $this->_fkeys[$this->table];
+
+
+ // $fk[$this->table][$tref[1]] = $tref[2] . ":" . $tref[3];
+
+ // loop through properties and create setter methods
+ foreach ($defs as $k => $info) {