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

Class: DB_DataObject_Cast

Source Location: /DB_DataObject-1.7.6/DataObject/Cast.php

Class Overview




Author(s):

Version:

  • $Id: Cast.php,v 1.8 2005/02/28 09:54:07 alan_k Exp $

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 58]
  • Version: $Id: Cast.php,v 1.8 2005/02/28 09:54:07 alan_k Exp $
  • Abstract:

    Storage for Data that may be cast into a variety of formats.

    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 74]

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 75]


Type:   mixed


[ Top ]

$second =

[line 221]


Type:   mixed


[ Top ]

$type =

[line 66]

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

Type:   string


[ Top ]

$value =

[line 86]

Generic Data..
  • Access: public

Type:   string


[ Top ]

$year =

[line 76]


Type:   mixed


[ Top ]



Method Detail

blob   [line 102]

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 168]

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 140]

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 122]

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], [string $db = 'mysql'])

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

Parameters:

int   $to   —  Type (DB_DATAOBJECT_*
string   $db   —  (eg. mysql|mssql.....)

[ Top ]

toStringFromBlob   [line 371]

string toStringFromBlob( int $to, string $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_*
string   $db   —  (eg. mysql|mssql.....)

[ Top ]

toStringFromDate   [line 438]

string toStringFromDate( int $to, string $db)

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

Parameters:

int   $to   —  Type (DB_DATAOBJECT_*
string   $db   —  (eg. mysql|mssql.....)

[ Top ]

toStringFromDateTime   [line 465]

string toStringFromDateTime( int $to, string $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_*
string   $db   —  (eg. mysql|mssql.....)

[ Top ]

toStringFromSql   [line 514]

string toStringFromSql( int $to, string $db)

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

Parameters:

int   $to   —  Type (DB_DATAOBJECT_*
string   $db   —  (eg. mysql|mssql.....)

[ Top ]

toStringFromString   [line 403]

string toStringFromString( int $to, string $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_*
string   $db   —  (eg. mysql|mssql.....)

[ Top ]

toStringFromTime   [line 492]

string toStringFromTime( int $to, string $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_*
string   $db   —  (eg. mysql|mssql.....)

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:28:10 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.