You are here

function DB_storage::toString in Flickr API 5

Output a simple description of this DB_storage object.

Return value

string object description

File

phpFlickr/PEAR/DB/storage.php, line 227

Class

DB_storage
Provides an object interface to a table row

Code

function toString() {
  $info = strtolower(get_class($this));
  $info .= " (table=";
  $info .= $this->_table;
  $info .= ", keycolumn=";
  if (is_array($this->_keycolumn)) {
    $info .= "(" . implode(",", $this->_keycolumn) . ")";
  }
  else {
    $info .= $this->_keycolumn;
  }
  $info .= ", dbh=";
  if (is_object($this->_dbh)) {
    $info .= $this->_dbh
      ->toString();
  }
  else {
    $info .= "null";
  }
  $info .= ")";
  if (sizeof($this->_properties)) {
    $info .= " [loaded, key=";
    $keyname = $this->_keycolumn;
    if (is_array($keyname)) {
      $info .= "(";
      for ($i = 0; $i < sizeof($keyname); $i++) {
        if ($i > 0) {
          $info .= ",";
        }
        $info .= $this->{$keyname[$i]};
      }
      $info .= ")";
    }
    else {
      $info .= $this->{$keyname};
    }
    $info .= "]";
  }
  if (sizeof($this->_changes)) {
    $info .= " [modified]";
  }
  return $info;
}