dbscript
[ class tree: dbscript ] [ index: dbscript ] [ all elements ]

Class: Database

Source Location: /database.php

Class Overview


Database


Author(s):

Version:

  • 0.1.2

Variables

Methods


Child classes:

MySQL
MySQL
PostgreSQL
PostgreSQL

Class Details

[line 37]
Database

Connects to the database, fetches records into data objects and performs CRUD operations.

Usage:

  1.  $db new PostgreSQL(
  2.    'host',
  3.    'db',
  4.    'user'
  5.  );

More info... http://dbscript.net/database




Tags:

version:  0.1.2
access:  public
author:  Brian Hendrickson <brian@dbscript.net>


[ Top ]


Class Variables

$conn =

[line 43]

connection resource used to access the database


Type:   resource


[ Top ]

$datatype_map =

[line 91]

datatype groupings


Type:   string[]


[ Top ]

$db_open =

[line 49]

true if the database is connected


Type:   bool


[ Top ]

$max_blob_length =

[line 73]

maximum binary file size


Type:   integer


[ Top ]

$max_string_length =

[line 79]

maximum string length


Type:   integer


[ Top ]

$models =

[line 55]

array of data models


Type:   Model[]


[ Top ]

$recordsets =

[line 61]

array of recordsets


Type:   RecordSet[]


[ Top ]

$tables =

[line 67]

tables


Type:   tables


[ Top ]

$true_values =

[line 85]

poss. values for boolean true


Type:   string[]


[ Top ]



Class Methods


method delete_record [line 448]

boolean delete_record( Record &$rec)

Delete Record

save a record's attributes into the database




Tags:

access:  public
author:  Brian Hendrickson <brian@dbscript.net>


Parameters:

Record   &$rec   rec

[ Top ]

method distinct_values [line 245]

string[] distinct_values( string $table, string $field, [string $orderby = ""])

Distinct Values

set the file upload size limit




Tags:

access:  public
author:  Brian Hendrickson <brian@dbscript.net>


Parameters:

string   $table   table
string   $field   field
string   $orderby   orderby

[ Top ]

method fetch_record [line 269]

void fetch_record( Record &$rec, integer $id)

Fetch Record

set the file upload size limit




Tags:

access:  public
author:  Brian Hendrickson <brian@dbscript.net>


Parameters:

Record   &$rec   rec
integer   $id   id

[ Top ]

method get_inline_url [line 182]

string get_inline_url( string[] $blob_location, string $content_type)

Get Inline Url

deprecated




Tags:

access:  public
author:  Brian Hendrickson <brian@dbscript.net>


Parameters:

string[]   $blob_location   blob_location
string   $content_type   content_type

[ Top ]

method get_mapped_datatype [line 294]

void get_mapped_datatype( string $raw_datatype, string 1)

Get Mapped Datatype

return the abstract type for a given native type




Tags:

access:  public
author:  Brian Hendrickson <brian@dbscript.net>


Parameters:

string   1  
string   $raw_datatype   raw_datatype

[ Top ]

method get_objects [line 315]

Model[] &get_objects( )

Get Objects

return the data model objects in an array




Tags:

access:  public
author:  Brian Hendrickson <brian@dbscript.net>


[ Top ]

method get_record [line 103]

Record get_record( string $table)

Get Record

return a Record object for the named table




Tags:

access:  public
author:  Brian Hendrickson <brian@dbscript.net>


Parameters:

string   $table   table

[ Top ]

method get_recordset [line 167]

RecordSet get_recordset( string $sql)

Get RecordSet

return a multi-graph RecordSet from a SQORP-formatted SQL join query




Tags:

access:  public
author:  Brian Hendrickson <brian@dbscript.net>


Parameters:

string   $sql   sql

[ Top ]

method iterator_load_record [line 131]

Record iterator_load_record( string $table, string[] $fields, recordset $rs, [integer $id = NULL])

Iterate Record

return a Record object from the Model's active result set




Tags:

access:  public
author:  Brian Hendrickson <brian@dbscript.net>


Parameters:

string   $table   table
string[]   $fields   fields
recordset   $rs   rs
integer   $id   id

[ Top ]

method max_upload_megabytes [line 205]

void max_upload_megabytes( integer $megabytes)

Max Upload Megabytes

set the file upload size limit




Tags:

access:  public
author:  Brian Hendrickson <brian@dbscript.net>


Parameters:

integer   $megabytes   megabytes

[ Top ]

method primary_key_for [line 383]

void primary_key_for( $table)



Parameters:

   $table  

[ Top ]

method save_record [line 405]

void save_record( Record &$rec)

Save Record

save a record's attributes into the database




Tags:

access:  public
author:  Brian Hendrickson <brian@dbscript.net>


Parameters:

Record   &$rec   rec

[ Top ]

method set_attributes [line 357]

void set_attributes( Record &$rec, string[] &$fields)

Set Data Array

populate a data object's attributes array




Tags:

access:  public
author:  Brian Hendrickson <brian@dbscript.net>


Parameters:

Record   &$rec   rec
string[]   &$fields   fields

[ Top ]

method skeletor [line 219]

Record skeletor( Record &$rec)

Skeletor

create a skeleton from an existing Record




Tags:

access:  public
author:  Brian Hendrickson <brian@dbscript.net>


Parameters:

Record   &$rec   rec

[ Top ]

method table_exists [line 342]

Model[] table_exists( $table)

Table Exists

return whether a table exists




Tags:

access:  public
author:  Brian Hendrickson <brian@dbscript.net>


Parameters:

   $table  

[ Top ]


Documentation generated on Mon, 19 Feb 2007 10:24:45 -0800 by phpDocumentor 1.3.1