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

Class: TSperiod

Source Location: /TSperiod.php

Class Overview

WBobject
   |
   --TSperiod

This class manages TSperiod objects. Collection of periods of time available with time related details.


Author(s):

Version:

  • 1.1

Variables

Methods


Inherited Methods

Class: WBobject

WBobject::__construct()
Construction function
WBobject::addToDB()
Rows insertion to database function
WBobject::deleteFromDB()
Rows deletion function
WBobject::getIDrowname()
ID rowname obtention function
WBobject::getObjects()
Objects list obtention function
WBobject::getUniqueFromDB()
Unique Row obtention function
WBobject::objectToArray()
Object to array transformation function
WBobject::updateDB()
Rows update function

Class Details

[line 31]
This class manages TSperiod objects. Collection of periods of time available with time related details.

Created on 07 jul 09

Changes: 1.0 -> 1.1: 14 jul 09 updated: file is PEAR compatible




Tags:

author:  Pierre-Dominique Vienne <pvienne@me.com>
version:  1.1
usedby:  SPsetup::updateSPcycle()
usedby:  SPsetup::createSPsetup()
license:  GNU Public License


[ Top ]


Class Variables

$aObjects = array(
        "tsPeriodCategory" => "TSperiodType", "tsPeriodNext" => "TSperiod")

[line 109]

Variable that contains objects list



Tags:

access:  protected

Type:   array


[ Top ]

$database =  "prysma"

[line 37]

Variable that contains database name



Tags:

access:  public

Type:   string


[ Top ]

$sIDrowname =  "tsPeriodID"

[line 104]

Variable that contains ID rowname



Tags:

access:  protected

Type:   string


[ Top ]

$table =  "TSperiod"

[line 42]

Variable that contains table name



Tags:

access:  public

Type:   string


[ Top ]

$tsPeriodCategory =

[line 58]

Variable that contains category of the period (object)



Tags:

access:  public

Type:   object


[ Top ]

$tsPeriodCategoryID =

[line 63]

Variable that contains category of the period (ID)



Tags:

access:  public

Type:   int


[ Top ]

$tsPeriodCode =

[line 53]

Variable that contains code of the period



Tags:

access:  public

Type:   string


[ Top ]

$tsPeriodDay0 =

[line 83]

Variable that contains tsPeriodStart - date(1,1,2000)



Tags:

access:  public

Type:   int


[ Top ]

$tsPeriodDays =

[line 78]

Variable that contains number of days of the period



Tags:

access:  public

Type:   int


[ Top ]

$tsPeriodEndTS =

[line 73]

Variable that contains end date of the period (timestamp)



Tags:

access:  public

Type:   int


[ Top ]

$tsPeriodID =

[line 48]

Variable that contains object ID



Tags:

access:  public

Type:   int


[ Top ]

$tsPeriodLast =

[line 98]

Variable that contains flag defining if period is the last one



Tags:

access:  public

Type:   int


[ Top ]

$tsPeriodNext =

[line 88]

Variable that contains next period (object)



Tags:

access:  public

Type:   object


[ Top ]

$tsPeriodNextID =

[line 93]

Variable that contains next period (ID)



Tags:

access:  public

Type:   int


[ Top ]

$tsPeriodStartTS =

[line 68]

Variable that contains start date of the period (timestamp)



Tags:

access:  public

Type:   int


[ Top ]



Class Methods


method createTSperiod [line 153]

object created createTSperiod( string $this->tsPeriodCode, object $this->tsPeriodCategory, int $this->tsPeriodStartTS, int $this->tsPeriodEndTS, int $this->tsPeriodDays, object $this->tsPeriodNext)

TSperiod object creation function

This function is used to create a TSperiod object Result is stored in $this and object is returned

  1.  <?php
  2.  $aVars     array(
  3.       "tsPeriodCode" => "fooCode",
  4.       "tsPeriodCategory" => $oTSperiodType,
  5.       "tsPeriodStartTS" => 1234395090,
  6.       "tsPeriodEndTS" => "1234567890",
  7.       "tsPeriodDays" => 2,
  8.       "tsPeriodNext" => $oTSperiod
  9.  );
  10.  $oTSperiod new TSperiod($aVars);
  11.  echo $oTSperiod->createTSperiod()->tsPeriodID;
  12.  // periodID
  13.  ?>




Tags:

return:  object or false
since:  Version 1.0
uses:  WBobject::addToDB()


Parameters:

string   $this->tsPeriodCode   code of the period (required)
object   $this->tsPeriodCategory   category of the period (required)
int   $this->tsPeriodStartTS   start date of the period (required)
int   $this->tsPeriodEndTS   end date of the period (required)
int   $this->tsPeriodDays   number of the period (required)
object   $this->tsPeriodNext   next period

[ Top ]

method deleteTSperiod [line 426]

bool deleteTSperiod( int $this->tsPeriodID)

TSperiod object deletion function

This function is used to delete a TSperiod by its ID Result is returned

  1.  <?php
  2.  $aVars                array("tsPeriodID" => 12);
  3.  $oTSperiod            new TSperiod($aVars);
  4.  echo $oTSperiod->deleteTSperiod();
  5.  // 1
  6.  ?>




Tags:

return:  true or false weither the object could be deleted or not
since:  Version 1.0
uses:  WBobject::deleteFromDB()


Parameters:

int   $this->tsPeriodID   ID of the period to be deleted (required)

[ Top ]

method getTSperiod [line 467]

object TSperiod getTSperiod( int $this->tsPeriodID)

TSperiod object obtention function

This function is used to get a TSperiod by its ID Result is returned

  1.  <?php
  2.  $aVars                array("tsPeriodID" => 12);
  3.  $oTSperiod            new TSperiod($aVars);
  4.  echo $oTSperiod->getTSperiod()->tsPeriodDays;
  5.  // 2
  6.  ?>




Tags:

return:  object
since:  Version 1.0
usedby:  SPsetup::getSPsetup()
uses:  WBobject::getUniqueFromDB()


Parameters:

int   $this->tsPeriodID   ID of the period to get (required)

[ Top ]

method updateTSperiod [line 292]

object updated updateTSperiod( int $this->tsPeriodID, string $this->tsPeriodCode, object $this->tsPeriodCategory, int $this->tsPeriodStartTS, int $this->tsPeriodEndTS, int $this->tsPeriodDays, object $this->tsPeriodNext)

TSperiod object update function

This function is used to update a TSperiod Result is stored in $this and object is returned

  1.  <?php
  2.  $aVars     array(
  3.       "tsPeriodID" => 12,
  4.       "tsPeriodCode" => "fooCode",
  5.       "tsPeriodCategory" => $oTSperiodType,
  6.       "tsPeriodStartTS" => 1234395090,
  7.       "tsPeriodEndTS" => 1234567890,
  8.       "tsPeriodDays" => 2,
  9.       "tsPeriodNext" => $oTSperiod
  10.  );
  11.  $oTSperiod new TSperiod($aVars);
  12.  echo $oTSperiod->updateTSperiod()->tsPeriodID;
  13.  // 12
  14.  ?>




Tags:

return:  object or false
since:  Version 1.0
uses:  WBobject::updateDB()


Parameters:

int   $this->tsPeriodID   ID of the period to be updated (required)
string   $this->tsPeriodCode   code of the period (required)
object   $this->tsPeriodCategory   category of the period (required)
int   $this->tsPeriodStartTS   start date of the period (required)
int   $this->tsPeriodEndTS   end date of the period (required)
int   $this->tsPeriodDays   number of days of the period (required)
object   $this->tsPeriodNext   next period

[ Top ]


Documentation generated on Wed, 26 Aug 2009 12:30:54 +0200 by phpDocumentor 1.4.1