library/core/class.form.php
public function SetData($Data) {
      if (is_object($Data) === TRUE) {
         // If this is a result object (/garden/library/database/class.dataset.php)
         // retrieve it's values as arrays
         if ($Data instanceof DataSet) {
            $ResultSet = $Data->ResultArray();
            if (count($ResultSet) > 0)
               $this->_DataArray = $ResultSet[0];
               
         } else {
            // Otherwise assume it is an object representation of a data row.
            $this->_DataArray = Gdn_Format::ObjectAsArray($Data);
         }
      } else if (is_array($Data)) {
         $this->_DataArray = $Data;
      }
   }
public function SetData($Data) {
      if (is_object($Data) === TRUE) {
         // If this is a result object (/garden/library/database/class.dataset.php)
         // retrieve it's values as arrays
         if ($Data instanceof DataSet) {
            $ResultSet = $Data->ResultArray();
            if (count($ResultSet) > 0)
               $this->_DataArray = $ResultSet[0];
               
         } else {
            // Otherwise assume it is an object representation of a data row.
            $this->_DataArray = Gdn_Format::ObjectAsArray($Data);
         }
      } else if (is_array($Data)) {
         $this->_DataArray = $Data;
      }
   }
public function SetData ( $ Data ) { if ( is_object ( $ Data ) === TRUE ) { // If this is a result object (/garden/library/database/class.dataset.php) // retrieve it's values as arrays if ( $ Data instanceof DataSet ) { $ ResultSet = $ Data -> ResultArray ( ) ; if ( count ( $ ResultSet ) > 0 ) $ this -> _DataArray = $ ResultSet [ 0 ] ; } else { // Otherwise assume it is an object representation of a data row. $ this -> _DataArray = Gdn_Format :: ObjectAsArray ( $ Data ) ; } } else if ( is_array ( $ Data ) ) { $ this -> _DataArray = $ Data ; } }
Assign a set of data to be displayed in the form elements.

@param Ressource $Data A result resource or associative array containing data to be filled in
Assign a set of data to be displayed in the form elements .