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

Class: DB_DataObject_Cast

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

Class Overview




Author(s):

Version:

  • $Id: Cast.php,v 1.6 2004/06/05 02:32:34 alan_k Exp $

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 58]
  • Version: $Id: Cast.php,v 1.6 2004/06/05 02:32:34 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 ]

$month =

[line 75]


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)

  • Access: public

Parameters:

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

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

toString   [line 222]

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

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

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 ]

toStringFromSql   [line 332]

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

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 ]


Documentation generated on Mon, 11 Mar 2019 13:55:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.