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

Class: DB_DataObject_Cast

Source Location: /DB_DataObject-1.11.5/DB/DataObject/Cast.php

Class Overview


Common usages:


Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 56]
Common usages:

// blobs $data = DB_DataObject_Cast::blob($somefile); $data = DB_DataObject_Cast::string($somefile); $dataObject->someblobfield = $data

// dates? $d1 = new DB_DataObject_Cast::date('12/12/2000'); $d2 = new DB_DataObject_Cast::date(2000,12,30); $d3 = new DB_DataObject_Cast::date($d1->year, $d1->month+30, $d1->day+30);

// time, datetime.. ?????????

// raw sql???? $data = DB_DataObject_Cast::sql('cast("123123",datetime)'); $data = DB_DataObject_Cast::sql('NULL');

// int's/string etc. are proably pretty pointless..!!!!

inside DB_DataObject, if (is_a($v,'db_dataobject_class')) { $value .= $v->toString(DB_DATAOBJECT_INT,'mysql'); }



[ Top ]


Class Variables

$day =

[line 72]

Data For date representation
  • Var: day/month/year
  • Access: public

Type:   int


[ Top ]

$hour =

[line 219]

Data For time representation ** does not handle timezones!!
  • Var: hour/minute/second
  • Access: public

Type:   int


[ Top ]

$minute =

[line 220]


Type:   mixed


[ Top ]

$month =

[line 73]


Type:   mixed


[ Top ]

$second =

[line 221]


Type:   mixed


[ Top ]

$type =

[line 64]

Type of data Stored in the object..
  • Var: (date|blob|.....?)
  • Access: public

Type:   string


[ Top ]

$value =

[line 84]

Generic Data..
  • Access: public

Type:   string


[ Top ]

$year =

[line 74]


Type:   mixed


[ Top ]



Method Detail

blob   [line 100]

object DB_DataObject_Cast blob( string $value)

Blob consructor

create a Cast object from some raw data.. (binary)

  • Access: public

Parameters:

string   $value   —  (with binary data!)

[ Top ]

date   [line 167]

object DB_DataObject_Cast date( vargs... 0)

Date Constructor

create a Cast object from some string (not binary) NO VALIDATION DONE, although some crappy re-calcing done!

  • Access: public

Parameters:

vargs...   0   —  accepts dd/mm dd/mm/yyyy yyyy-mm yyyy-mm-dd array(yyyy,dd) array(yyyy,dd,mm)

[ Top ]

dateTime   [line 242]

object DB_DataObject_Cast dateTime( vargs... 0)

DateTime Constructor

create a Cast object from a Date/Time Maybe should accept a Date object.! NO VALIDATION DONE, although some crappy re-calcing done!

  • Author: therion 5 at hotmail
  • Access: public

Parameters:

vargs...   0   —  accepts noargs (now) yyyy-mm-dd HH:MM:SS (Iso) array(yyyy,mm,dd,HH,MM,SS)

[ Top ]

sql   [line 138]

object DB_DataObject_Cast sql( string $value)

SQL constructor (for raw SQL insert)

create a Cast object from some sql

  • Access: public

Parameters:

string   $value   —  (with binary data!)

[ Top ]

string   [line 120]

object DB_DataObject_Cast string( string $value)

String consructor (actually use if for ints and everything else!!!

create a Cast object from some string (not binary)

  • Access: public

Parameters:

string   $value   —  (with binary data!)

[ Top ]

time   [line 305]

object DB_DataObject_Cast time( vargs... 0)

time Constructor

create a Cast object from a Date/Time Maybe should accept a Date object.! NO VALIDATION DONE, and no-recalcing done!

  • Author: therion 5 at hotmail
  • Access: public

Parameters:

vargs...   0   —  accepts noargs (now) HH:MM:SS (Iso) array(HH,MM,SS)

[ Top ]

toString   [line 353]

string toString( [int $to = false], object $db)

get the string to use in the SQL statement for this...
  • Access: public

Parameters:

int   $to   —  Type (DB_DATAOBJECT_*
object   $db   —  DB Connection Object

[ Top ]

toStringFromBlob   [line 372]

string toStringFromBlob( int $to, object $db)

get the string to use in the SQL statement from a blob of binary data ** Suppots only blob->postgres::bytea
  • Access: public

Parameters:

int   $to   —  Type (DB_DATAOBJECT_*
object   $db   —  DB Connection Object

[ Top ]

toStringFromDate   [line 478]

string toStringFromDate( int $to, object $db)

get the string to use in the SQL statement for a date
  • Access: public

Parameters:

int   $to   —  Type (DB_DATAOBJECT_*
object   $db   —  DB Connection Object

[ Top ]

toStringFromDateTime   [line 506]

string toStringFromDateTime( int $to, object $db)

get the string to use in the SQL statement for a datetime
  • Author: therion 5 at hotmail
  • Access: public

Parameters:

int   $to   —  Type (DB_DATAOBJECT_*
object   $db   —  DB Connection Object

[ Top ]

toStringFromSql   [line 557]

string toStringFromSql( int $to, object $db)

get the string to use in the SQL statement for a raw sql statement.
  • Access: public

Parameters:

int   $to   —  Type (DB_DATAOBJECT_*
object   $db   —  DB Connection Object

[ Top ]

toStringFromString   [line 426]

string toStringFromString( int $to, object $db)

get the string to use in the SQL statement for a blob from a string! ** Suppots only string->postgres::bytea
  • Access: public

Parameters:

int   $to   —  Type (DB_DATAOBJECT_*
object   $db   —  DB Connection Object

[ Top ]

toStringFromTime   [line 534]

string toStringFromTime( int $to, object $db)

get the string to use in the SQL statement for a time
  • Author: therion 5 at hotmail
  • Access: public

Parameters:

int   $to   —  Type (DB_DATAOBJECT_*
object   $db   —  DB Connection Object

[ Top ]


Documentation generated on Mon, 11 Mar 2019 16:03:56 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.